We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF to image conversion is slow

We are using Aspose PDF .NET 18.2 to convert document pages into images. Some documents take extremely long to convert. I’ve uploaded an example file. There is only one page in it, but the conversion of that page took 27 seconds on my machine (not the slowest one).

Here is the code used for conversion (300 dpi is required).

var source = @"SlowSinglePage.pdf";
        using (var sourceStream = File.Open(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using (var pdf = new Document(sourceStream))

                for (var page = 1; page <= pdf.Pages.Count; page++)
                    var output = source + ".jpg";
                    var dev = new JpegDevice(new Resolution(300));
                    var pdfPage = pdf.Pages[page];
                    var sw = new Stopwatch();
                    dev.Process(pdfPage, output);
                    Console.WriteLine($"Page {page} converted in {sw.ElapsedMilliseconds:F} ms");

SlowSinglePage.pdf (1.2 MB)

What is causing the slow conversion?


Thank you for contacting support.

We have worked with the data shared by you and have been able to reproduce the issue in our environment. A ticket with ID PDFNET-45300 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.