Hi
I need your help.
I can implement page break from html to pdf whit this...
string PageBreakA => "<p style='page-break-after: always;'></p>";
string PageBreakB => "<p style='page-break-before: always;'></p>";
but in Word not works, please help!
|
WordDocument document = new WordDocument();
document.EnsureMinimal();
WParagraph paragraph = document.Sections[0].Body.LastParagraph as WParagraph;
paragraph.AppendHTML("<br style=\'page-break-after: always;\'></br><br style=\'page-break-before: always;\'></br>");
document.Save(@"sample_using breaktag.docx");
document.Close(); |
Hi
I need to place page breaks in the places where they were set in the html code, how can i implement it when converting it to word, since i don't know the paragraph and the place where the user has placed the page breaks
Please help me,
Hi Jose,
From the given details, we have suspected that your requirement is to add page
break where the HTML code inserted. To achieve this, we have suggested you to
add a page break before or after the HTML code inserted into the paragraph. Please
refer the below highlighted code snippets to achieve your requirement.
|
WordDocument document = new WordDocument(); document.EnsureMinimal(); WParagraph paragraph = document.Sections[0].Body.LastParagraph as WParagraph; //Adds page break before the HTML code inserted into the paragraph. paragraph.AppendBreak(BreakType.PageBreak); paragraph.AppendHTML("<p>This text is inserted as HTML string.</p>"); //Adds page break after the HTML code inserted into the paragraph. paragraph.AppendBreak(BreakType.PageBreak); document.Save(@"sample.docx"); document.Close(); |
Please refer our UG documentation link to know about how to add page break to
the paragraph,
https://help.syncfusion.com/file-formats/docio/working-with-paragraph#appending-breaks
If we misunderstood any of your requirements, then kindly provide us complete
end requirement along with input template, and screenshot/output document of
the expected result which will helpful to provide you the appropriate solution
at the earliest.
Regards,
Suriya Balamurugan.