Slow PDF to PDF/A conversion of documents with many pages

Problem: The attached document is only 1MB in size, having 84 pages. Converting this to PDF/A takes 90 seconds. Can this be improved given the simplicity of the document?

Host: Win11
Runtime: .NET 6
Library: Aspose.Drawing.Pdf 23.4.0 and 23.5.0
Mode: Release

Free_Test_Data_1MB_PDF (1).pdf (1.0 MB)

Code

using PdfDocument = Aspose.Pdf.Document;

using var inputPdfFileStream = File.OpenRead(inputFilename);
var document = new PdfDocument(inputPdfFileStream);
AllowPrintDocumentPrivilege(document);

var timestamp = $"{DateTime.Now:yyyy-MM-dd-HH-mm-ss}";
var convertLogFilename = $"{timestamp}_{inputFilename}_convert.log";
var outputFilePath = Path.Combine(outputPath.FullName, $"{inputFilename}_{timestamp}.pdf");
document.Convert(convertLogFilename, pdfFormat, ConvertErrorAction.Delete);
document.Save(outputFilePath, CreateSaveOptions());

private static void AllowPrintDocumentPrivilege(Document document)
    {
        var fileSecurity = new PdfFileSecurity(document);
        fileSecurity.SetPrivilege(DocumentPrivilege.AllowAll);
    }

private static PdfSaveOptions CreateSaveOptions() => new()
    {
        DefaultFontName = "Arial"
    };

@ILikeCranberries

We tested your document with Aspose.PDF for .NET 23.5 and it took 15 seconds in our environment. Can you please share the complete environment details for our reference like OS Name and Version, Installed RAM size, debug mode, etc.? We will further proceed to assist you accordingly.

Thank you for your response. Updated the original post with additional information.

The result I’m getting are as follows:

  • Aspose.PDF.Drawing 23.4: 101s
  • Aspose.PDF.Drawing 23.5: 100s
  • Aspose.PDF 23.4: 13.5s

The problem only happens in Aspose.PDF.Drawing since Aspose.PDF performance matches what you had reported.

@ILikeCranberries

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-54669

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.