We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Header/Footer and Right-Alignment Issues

We are having issues with Word documents we are converting. The documents contains a header and a footer and the horizontal rule they contain wraps strangely at certain content resolutions. Another issue we are having is some of the content which is right-aligned in the original documents appears with a different alignment when converted. This can be seen in the screenshots for the content with the month and year ranges following NURSING EXPERIENCE. Attached are the screenshots and the example Word documents.

Hi John,

Thanks for your inquiry. There is section break before text "NURSING EXPERIENCE" in your document. The HtmlSaveOptions.ExportHeadersFootersMode property specifies how headers and footers are output to HTML, MHTML or EPUB. The default value is PerSection for HTML/MHTML.

It is hard to meaningfully output headers and footers to HTML because HTML is not paginated. When this property is PerSection, Aspose.Words exports only primary headers and footers at the beginning and the end of each section. When it is FirstSectionHeaderLastSectionFooter only first primary header and the last primary footer (including linked to previous) are exported. You can disable export of headers and footers altogether by setting this property to None.

In your case, we suggest you please use HtmlSaveOptions.ExportHeadersFootersMode property with value FirstSectionHeaderLastSectionFooter. Hope this helps you.

Thank you for your suggestion for the headers and footers. I will attempt to try the option. Could you clarify more on the cause of the alignment issue?

Hi John,

Thanks for your inquiry. You are facing the expected behavior of Aspose.Words. The paragraph (July 20, 2016 ... tab stop ... Page 1 of 2) in document's footer contains the tab stop and has left alignment.

However, the paragraph (Alison Gogetter, MSN, RN) in header has right alignment. If you copy these contents in new empty document using MS Word and save them into HTML file format, you will get the same output.

In your case, we suggest you please put the contents of footer into table that have one row with two cell. Set the alignment of text "Page {PAGE} of {NUMPAGES}" as right and remove the table's border.

You may save your document to HTML_FIXED. Hope this helps you.