File Orientation not maintained when converted from HTML to DOCX

Hi,

Greetings.

We use Aspose.words Java to convert docx file to html and html to docx.

The docx file have pages in both orientations(portrait and landscape).
The docx file is converted to html, then after editing it is again converted to docx.
While converting the html file to docx the pages in landscape orientation is not maintained, all the pages are in portrait orientation, so some contents are missed and misaligned.

Please suggest ways we can mitigate this and let us know your valuable suggestions to resolve this issue

Please check the original docx file attached.
orientation_error.zip (88.2 KB)

@EdwinPearson,

To preserve Orientation of pages during DOCX to HTML to Word conversions, please set HtmlSaveOptions.ExportPageSetup property to true:

Document doc = new Document("C:\\temp\\orientation_error\\orientation_error.docx");
com.aspose.words.HtmlSaveOptions htmlSaveOptions = new com.aspose.words.HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setPrettyFormat(true);
htmlSaveOptions.setExportPageSetup(true);
doc.save("C:\\Temp\\orientation_error\\21.3.html", htmlSaveOptions);

Document html = new Document("C:\\temp\\orientation_error\\21.3.html");
html.save("C:\\Temp\\orientation_error\\21.3.docx");