Convert PDF to Xps creates bloated file

I converted the attached 10 page 10mb pdf file to xps and created a massive bloated 71mb .xps file using the following code:



Is there a better way? help!



MemoryStream inStreamPdf = new MemoryStream(inDocument);

Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(inStreamPdf);

MemoryStream outStreamPdf = new MemoryStream();

pageCountDocument = pdfDoc.Pages.Count.ToString();

pdfDoc.Save(outStreamPdf, Aspose.Pdf.SaveFormat.Xps);

outStreamPdf.Position = 0;

outDocument = outStreamPdf.ToArray();



Best Regards,

David

Hi David,


Thanks for contacting support.

I have tested the scenario and I am able to
notice the same problem that size of resultant XPS becomes 7 times of input PDF file. For the sake of correction, I have logged this problem
as PDFNEWNET-36371 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.

The issues you have found earlier (filed as PDFNET-36371) have been fixed in Aspose.PDF for .NET 25.9.