Hello
I have a similar issue as the original poster.
I have to convert a huuuge PDF (1GB, 7'500 pages) to images.
When I do this with a normal loop, the first 109 pages take 0.5 seconds per page.
So this would mean that for 7'500 pages it takes roughly an hour, which would be acceptable, considering the size of the PDF as well.
But unfortunately, the time increases immensely afterwards and it takes 8 seconds per page, leading to 12 hours for 7'500 pages.
I have created a test project using Spire.PDF for .Net V8.11.10 where I can reproduce this behavior.
For that, I first create a PDF with 7000 identical pages.
By measuring the time it takes per 100 pages, I can see that the later pages take longer to convert to images.
It has nothing to do with memory problems, because it doesn't matter if I first convert pages 0-100 and then 600-700 or first 600-700 and then 0-100.
The pages from 600-700 always take way longer than the ones from 0-100.
I also don't store the images, in a real scenario I of course would have to create files from them.
What I noticed is the following curious thing:
If I split the PDF in multiple smaller ones, then splitting pages 0-100 and 600-700 takes the same amount of time!
And then converting the smaller PDF to images also takes consistent time.
So, for a large PDF, it is actually faster to:
1. Read the PDF
2. Split it into multiple smaller ones
3. Read each small PDF and convert all pages into single images.
It seems to me, that the method
PdfDocument.InsertPageRange has a more performant way of accessing the pages than
PdfDocument.SaveAsImage does!
Could you please try to solve this issue so that it doesn't matter if the image is from the first or the 1134th page?
Because right now it's really ridiculously slow, as you can see from my screenshots in the attachments.
P.S: I have done the tests with a license applied. However, I've not included it in this test project, for obvious reasons
Login to view the files attached to this post.