Open hisphone opened 8 months ago
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
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 {
XMLBuilder::new()
.indent(
self.start,
self.special_indent,
self.end.unwrap_or_default(),
self.start_chars,
)
.build()
}
}