Free Support Forum -

PDF to XPS in memory without printing to XPS Printer


I searched the support forum for a solution to convert a PDF to XPS, but I found only a possibility with the Aspose.Pdf.Kit sending the file to a printer on the file system: (posts from 2006 - 2008)

We have the Aspose.Total package, and are able to convert all Microsoft formats to PDF and to XPS, however I can’t find a “simple” convert from PDF to XPS in memory.

Is that possible, without sending it to a printer?

Thank you very much,

Hello Cassy,

Thanks for your interest in our products.

From your requirement, do you mean you need to save the resultant XPS file into MemoryStream object ? or you need to read the source PDF from MemoryStream?

In fact, I read out the PDF file in memory, as I do with Word, Excel, etc files. I offer it to Aspose with a Stream object and I want a XPS Stream back from Aspose.

I’m now working out a work around to print out the PDF as XPS file with the “Microsoft XPS Document Writer”, to a temp location on disk, read it out again as a FileStream, but that’s a big work - around.

Practically all Aspose components (.Words, .Cells, .Slides) are able to convert a file into XPS, why isn’t Aspose.Pdf or Aspose.Pdf.Kit offering that functionality?

Hello Cassy,

Thanks for sharing the details. I am sorry to inform you that currently Aspose.Pdf for .NET does not support the feature to save resultant XPS in Stream Object. However I have logged this requirement as PDFNEWNET-29149 in our issue tracking system under new features list. We will further look into the details of this requirement and will keep you updated on the status of correction. Please be patient and spare us little time.

We apologize for your inconvenience.

Are there any updates according this issue ?

Hello Cassy,

Thanks for your patience.

Our development team is still working over this requirement and I am afraid it’s not yet implemented. Meanwhile, I have requested the development team to share the ETA regarding its resolution. Please be patient and spare us little time. We are really sorry for the delay and inconvenience.


I am pleased to share that the feature to convert PDF file into XPS format and save the result in StreamObject will become available in our upcoming release version of Aspose.Pdf for .NET 6.3.0. You may try using the following code snippet to save .XPS file into Stream object. Please be patient and wait for the new release version.

Aspose.Pdf.Document doc = new Aspose.Pdf.Document (srcPdfFile);

Aspose.Pdf.XpsSaveOptions saveOptions = new Aspose.Pdf.XpsSaveOptions();
FileStream fs = new FileStream(outXpsFile, FileMode.Create);
doc.Save(fs, saveOptions);

The issues you have found earlier (filed as 29149 ) have been fixed in this update.

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