Closed arifd closed 1 year ago
You need to use Run::add_break(BreakType::TextWrapping)
instead of \n
.
such as:
pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./hello.docx");
let file = std::fs::File::create(path).unwrap();
Docx::new()
.add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello").add_break(BreakType::TextWrapping).add_text("world")))
.build()
.pack(file)?;
Ok(())
}
Oh, that's painful, but ok! Thanks for your help. :)
Describe the bug
will not produce text on two lines
Reproduced step
Expected behavior
Actual behavior