We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Slow conversions: PDF to XPS to PDF on Aspose 10.7.0 version

Dear Support,
I have a following code snippet that converts a Pdf to Xps and then again back to PDF.

With Aspose Pdf on .Net version 10.3.0 processing time is less than 20 seconds, but on version 10.7.0, takes more than 30 secs. Is this a known bug? What is the faster way to convert pdf-xps-pdf on 10.7.0? Attached document.

Aspose.Pdf.License pdfLicense = new Aspose.Pdf.License();

pdfLicense.Embedded = true;
//open document
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(filename);
//Get page collection
Aspose.Pdf.PageCollection pageCollection = pdfDocument.Pages;
//during conversion process, the validation is also performed
// Instantiate XPS Save options
Aspose.Pdf.XpsSaveOptions saveOptions = new Aspose.Pdf.XpsSaveOptions();
pdfDocument.Save(root + “/” + id + “.xps”, saveOptions);
//save back to pdf
// Instantiate XpsLoadOptions object using XPS load option
Aspose.Pdf.XpsLoadOptions options = new Aspose.Pdf.XpsLoadOptions();
// Create document object
Aspose.Pdf.Document document = new Aspose.Pdf.Document(root + “/” + id + “.xps”, options);
// Save the resultant PDF document
document.Save(root + “/” + id + “.pdf”);

Thank you,

Hi Sireesha,

Thanks for using our API’s.

I have tested the scenario using Aspose.Pdf for .NET 10.7.0 in Visual Studio 2010 project with .NET Framework 4.0 running over Windows 7 (x64) and as per my observations, the whole conversion process (PDF to XPS and XPS to PDF) is completed in 13 seconds. Please share some details regarding your working environment.

PS, I have used intel Core i5 2.5 Ghz with 4GB of RAM.