PDF rendering slowness issues

We were evaluating Aspose’s PDf libraries to serve as a replacement to our current PDF libraries (PDFNet). We generally liked the product, and were considering purchasing a site OEN license when we hit a serious blocker.


Aspose’s PDF rendering is at least 10 times slower than PDFNet.

It varies of course depending on the resolution and bit depth of the source PDF, but PDFs that render in 4s in PDFNet were taking 40s in Aspose.

This leads me to wonder if I have improperly implemented something.

The use case is to take a PDF and convert it to multiple single page tiffs. It is preferred that the PDFs be group 4 compressed bitonal tiffs with dithered images, but this is not strictly required.

Below is the code I was using to evaluate:


public static void AsposeConvertPDFToTiff(string filename, string outputDir)
{
Document pdfDocument = new Document(filename);
//Create Resolution object
Resolution resolution = new Resolution(300);

//Create TiffSettings object
TiffSettings tiffSettings = new TiffSettings();
tiffSettings.Compression = CompressionType.CCITT4;
tiffSettings.Shape = ShapeType.None;
tiffSettings.SkipBlankPages = false;
tiffSettings.Depth = ColorDepth.Format1bpp;

//Create TIFF device
TiffDevice tiffDevice = new TiffDevice(resolution, tiffSettings);

for (int i = 1; i <= pdfDocument.Pages.Count; i++)
{
string baseFilename = Path.Combine(outputDir, “Asposeout”);
string targetFilename = baseFilename + “-” + i.ToString() + “.tif”;
//Convert a particular page and save the image to stream
tiffDevice.Process(pdfDocument, i, i, targetFilename);
}
}

The product was licensed earlier in the code using a temporary license file.

Hi Joseph,


Thanks for your interest in Aspose. We will Appreciate it if you please share your sample PDF document, so we will test the performance issue and will guide you accordingly.

Furthermore, please note Aspose.Pdf processes documents in memory instead temporary files, so performance can be vary because of the file size/contents and system resources.

We are sorry for the inconvenience caused.

Best Regards,

Not a problem. The actual PDf is not particularly relevant except in degree. I have attached a sample PDF. This is a standard 1040 document I use to test form fields and flattening when converting PDFs to tiffs.


When rasterizing this document to a bitonal tiff, I have found the following

LeadTools 600 ms
PDFTron 900 ms
PDFium Project 422 ms
Aspose 3400 ms

This is not as bad as conversion of color documents, but it is still a significant speed issue when you are processing thousands of pdfs per day.

Hi Joseph,


Thanks for sharing the sample document and additional information. I have tested the scenario at my end and noticed it is taking almost 4000 ms, so logged an investigation ticket PDFNEWNET-40575 in our issue tracking system for further investigation and rectification. We will keep you updated about the issue resolution progress within this forum thread.

We are sorry for the inconvenience caused.

Best Regards,