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

Free Support Forum - aspose.com

Html document to landscape orientation problem

Hi,


I have an HTML file (attached: Landscape.html) which has some MSWord specific CSS added to it to make Word interpret it as a landscape document.

When I open this HTML file in Aspose and save it as a Word document, the landscape option seems to be correctly interpreted and de document looks fine.
I was however not aware of this CSS setting and I applied the following code to force my document into landscape mode (this is a piece of testing code):

##################################################################
Document baseDoc = new Document(“Landscape.html”);
baseDoc.Save(“Vanilla.docx”);

foreach (Aspose.Words.Section section in baseDoc.Sections)
{
section.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
}
baseDoc.Save(“Vanilla_Landscapeified.docx”);

Document landscapeified = new Document(“Vanilla_Landscapeified.docx”);
foreach (Aspose.Words.Section section in landscapeified.Sections)
{
section.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
}
baseDoc.Save(“Landscapeified_Landscapeified.docx”);
##################################################################

When opening the “Vanilla_Landscapeified.docx” document, all pages appear to be positioned in portrait instead of landscape?
I am thinking that Aspose correctly interpretes the MSWord specific CSS line “mso-page-orientation:landscape;” but forgets to mark the sections as being oriented in landscape mode?

Opening the landscapeified document and re-applying the Landscape oriëntation does not have an effect on the final “Landscapeified_Landscapeified.docx” document so I think Aspose made a wrong initial assumption of the document dimensions/orientation.

I need to be able to force any document that I receive into landscape or portrait mode, independant on the source file I get (word or HTML), for printing.
This seems to me like a small malfunctioning inside Aspose or is this actually intended behaviour?

Hi Nick,

Thanks for your inquiry.

I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10576. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Tahir,


As this is kind of a blocking issue for us, do you have an estimate when this issue will be resolved in Aspose?
-------------------

I just saw that the issue is marked as resolved in this thread, does this mean I just have to wait for the next release, or is it silently included 14.8.0 already?

Hi Nick,

Thanks for your inquiry. Your issue has been resolved and its fix will be included in next
release of Aspose.Words i.e. 14.9.0. Hopefully, the Aspose.Words
(v14.9.0) will be available by the end of this month. We will inform you via this forum thread as soon as September 2014 release is published.

Thanks for your patience.

The issues you have found earlier (filed as WORDSNET-10576) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.