Hi Aspose Team,
Recently we started to use XPS to PDF conversion functionality from Aspose.PDF.dll library and noticed that on documents with >=80 pages conversion time takes 2 and more minutes. Document’s content is simple text.
As supposition it can be by design behavior of Aspose functionality, based on specific things of XPS/PDF format, and it is physically required to process document’s content during this time.
Maybe I have missed explanation/description for this case somewhere in documentation, but I would like to double check that this is not a bug.
Code example:
private static void ConvertXPSToPDF(string inputFile, string outputFile)
{
Aspose.Pdf.LoadOptions options = new Aspose.Pdf.XpsLoadOptions();
Aspose.Pdf.Document document = new Aspose.Pdf.Document(inputFile, options);
document.Save(outputFile);
}
Document example:
For instance, this particular document converts (loads new Aspose.Pdf.Document(inputFile, options)) almost 10 minutes:TestDoc.zip (1.2 MB)
BTW, as alternative I have tried to use Aspose.XPS.dll with functionality to convert to PDF. It work faster approximately in 2 times, but unfortunately it does not work for me as resulted PDF, even with flat compression, has very big size (useless for our functionality).
Code example with XPS lib:
private static void ConvertXPSToPDFExt(string inputFile, string outputFile)
{
XpsDocument doc = new XpsDocument(inputFile);
// Initialize PdfSaveOptions
Aspose.Xps.PdfSaveOptions pdfSaveOptions = new Aspose.Xps.PdfSaveOptions
{
// Specify TextCompression Style
TextCompression = PdfTextCompression.Flate,
ImageCompression = PdfImageCompression.Flate
};
// Save as PDF Document
doc.Save(outputFile, pdfSaveOptions);
}
Is there anything I have missed or anything I can specify to improve processing time?
If that is by design behavior, could you be more specific and explain why does it take so much time?
Thanks in advance.