Free Support Forum - aspose.com

Aspose.Words.Document generates inefficient XPS

I printed the attached Single Page.docx file from MS Word via the MS XPS Document Writer, generating the attached FromMSXPSWriter.xps

I then opened the same docx file inside an Aspose.Words.Document and saved out to the attached file FromAsposeWords.xps

I'm using the Visual Studio Extras OpenXMLEditor.vsix addin to open and examine xps files, but if you don't have that you can just unzip each xps file to a folder on your disk.

Both xps files have an XML content node named Documents/1/Pages/1.fpage

Looking in the aspose-generated 1.fpage node, there are 1717 lines of XML, and just about every word on the docx page is individually placed.

But in the MS-generated 1.fpage node there are just 61 lines of XML, one for each line of text on the page.

My app must post-process XPS content, and it takes far longer using XPS written by the aspose component. I'd much prefer the aspose XML to be more compact and efficient like the MS XML. There's no need for the aspose XPS content to be so verbose.

Hi Brian,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 16.4.0, we managed to reproduce this issue on our end. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-13572. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Many thanks for such a speedy response Awais.

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


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

Hi Brian,


Regarding WORDSNET-13572, please use the XpsSaveOptions.OptimizeOutput flag to get the desired result.

Best regards,

Hi Awais,

I confirm that when I use the OptimizeOutput flag the generated XPS is much more compact. The XPS for the test document I supplied reduced in size to 84 lines - a huge improvement. Many thanks.

Hi Brian,


Thanks for your feedback. In case you have further inquiries or need any help, please let us know.

Best regards,

The attachment I’d attached to my original post had been deleted somehow, so here it is again:

Bundle.zip (183.3 KB)

@Brian_THOMAS,

Thank you for uploading related documents again in this thread. We will also look into the issue as to why the previous attachment got deleted. We apologize for any inconvenience.