Converting PDF to JPEG or TIFF is slow

When using version 22.12 of Aspose.PDF to convert the attached PDF file to either JPEG or TIFF, it takes several minutes to complete. Converting other PDF files with a similar size and number of pages only takes seconds to complete.

DOC-000005202.pdf (159.3 KB)

Thanks for your assistance,
Michael Carey

@mcareyNuix

Can you please share the sample code for our reference? We will test the scenario in our environment and address it accordingly.

Below is the code being used. In test runs the first page of the PDF takes about 1 second to process and the subsequent pages take about 20 seconds each to process for both JPEG and TIFF.

var document = new Aspose.Pdf.Document(@“D:\DOC-000005202.pdf”);

var resolution = new Aspose.Pdf.Devices.Resolution(300);

var jpegDevice = new Aspose.Pdf.Devices.JpegDevice(resolution, 75);

foreach (var page in document.Pages)
{
var stopwatch = Stopwatch.StartNew();

jpegDevice.Process(page, $@"D:\DOC-000005202-{page.Number}.jpeg");

stopwatch.Stop();

Console.WriteLine($"Page {page.Number}: {stopwatch.ElapsedMilliseconds}");

}

var tiffSettings = new Aspose.Pdf.Devices.TiffSettings()
{
Compression = Aspose.Pdf.Devices.CompressionType.CCITT4,
Depth = Aspose.Pdf.Devices.ColorDepth.Format1bpp,
SkipBlankPages = false,
Brightness = .85f
};

var tiffDevice = new Aspose.Pdf.Devices.TiffDevice(resolution, tiffSettings);

foreach (var page in document.Pages)
{
var stopwatch = Stopwatch.StartNew();

tiffDevice.Process(document, page.Number, page.Number, $@"D:\DOC-000005202-{page.Number}.tiff");

stopwatch.Stop();

Console.WriteLine($"Page {page.Number}: {stopwatch.ElapsedMilliseconds}");

}

@mcareyNuix

We were able to notice the delay in conversion while testing the scenario in our environment. Therefore, have logged an issue as PDFNET-54077 in our issue tracking system. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.