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

Free Support Forum - aspose.com

Page Margin is not preserving :

Hi ,

I am using Aspose.words.java latest version for doc to html conversion. I am unable to preserve page margin after conversion . I have attached a sample document with this. Is there any other way to Set/Get page margin ?

Regards,
Anbu Chezhian.S

Hello

Thanks for your request. Let me explain little bit. Actually, HTML format is one page format and it does not support margins natively. If you try setting HtmlExportPageSetup property to True, you will see that Aspose preserves page setup information inside HTML:

doc.getSaveOptions().setHtmlExportPageSetup(true);
<style type="text/css">@page Section1 { margin:72pt 148.5pt 72pt 144pt; size:612pt 792pt }div.Section1 { page:Section1 }</style>

Also if you try saving your document to HTML using MS Word you will get the same result as Aspose.Words does.
Best regards,

How do you do this in VB.NET?

I figured it out. I didn’t have the Words.Saving namespace imported.

Hi Dan,
It is perfect that you found the solution. Please feel free to ask in case of any issues, we will be glad to help you.
Best regards,