docx-rs
docx-rs copied to clipboard
Add firstLineChars indent fearture
I want to set firstLineChars indent. But I found that I can set it, it's not writen to the xml. Can you add this feature to the crate.
impl BuildXML for Indent {
fn build(&self) -> Vec
Yes, you can use the special_indent parameter to set the first line indentation. The following snippet demonstrates how to set it up, and it has been verified to produce correct DOCX output:
Paragraph::new().add_run(Run::new().add_text(DUMMY)).indent(
Some(840), // the left margin of the paragraph
Some(SpecialIndentType::FirstLine(720)), // Used to set the first line indentation, hanging indentation
None,
None,
)
Environment: MacOs Version: Sonoma 14.3.1 docx-rs version: 0.4.8
Thanks for your help