Free Support Forum - aspose.com

Inserting Page Breaks explicitly while converting doc to pdf

Hi,

How can I explicitly insert a page break at the end of each page while converting a word doc to pdf?

The reason I want to do this is due to miss/improper usage of page breaks in original word doc, number of pages in converted pdf is different than original word doc.

We have large and complex word documents need to be converted to pdf with exact number of pages and same layout. Sometimes aspose conversion process is reducing/increasing number of pages. Moreover, some section headers are at the bottom of previous page instead of being at the top of next page.

I inserted page breaks manually at the end of each page in original word doc and conversion output was acceptable. Since this is a high priority issue for us and we can't force business authors to add page breaks manually, I was wondering how I can do that programmatically during conversion process.

I'll be glad if you can provide a sample code snippet for that.

Thanks

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. MS Word document is flow document and does not contain any information about its layout into lines and pages. So there is no way to determine where page starts or ends.

In Aspose.Words we use our own Rendering Engine, which layouts Word document into pages. This rendering engine is used to convert documents to fixed page formats like PDF, XPS and images.

Could you please attach your document here for testing? I will check the issue and provide you more information.

Best regards.