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.