Aspose.Word v2.5.0.0 - only first page prints

Started using this to generate envelopes and found that when you go to print the whole document, 2-99 pages each an envelope, it will only print the first envelope.

What gives?

Attached is a zip file containing the merge template (envelope.doc) and a test output (printDoc.doc). Printing this doc will not allow you to print both pages/envelopes at once.

-Rick

Hi

Thanks for your inquiry. I cannot reproduce the problem on my side. Both pages are printed without any issues.
Best regards.

Try with collate on. I was able to track down some MS references to printing ‘sections’ and collate on. Seems it doesn’t work.

Here are thread references ‘fixes’ but too bad there is no content to the threads.

Sections

Is there some settings i can use to replace the Aspose.Word inserted sections breaks with page breaks?

-Rick

Hello!
Thank you for your clarification.
As Roman wrote in the posts you are referencing, this problem is known but we have no idea how to solve it. It’s better to put contents into one section. You can also try the latest version of the product since Alexey was unable to reproduce the issue.
Section in Aspose.Words document model is a distinct object. So there are no explicit section breaks in the document that you could replace with page breaks. You can retain the first section and move all child nodes of subsequent sections to the first one delimiting them with page breaks:
builder.InsertBreak(BreakType.PageBreak);
… where builder is an instance of DocumentBuilder class.
The only drawback of this approach is that page settings of subsequent nodes will be lost. So the workaround is affordable if page setup of all nodes was identical or it is not significant.
Regards,