Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sat Sep 08, 2018 5:56 am

Hello,
I use Spire.PDF Professional.
When extracting PDF files to JPG, not all pages are extracted.
The currently applied hotfix version is 4.8.14.

Please refer to the following URL for example PDF file.

http://aspbuilder2.ezebn.com/20180908.pdf

cspi
 
Posts: 5
Joined: Tue Nov 21, 2017 2:18 am

Mon Sep 10, 2018 8:10 am

Hello,

Thanks for your post and sorry for the late reply as weekend.
I can save all pages of Pdf file to JPG successfully. Could you please provide your code fragment and more details of the pages which could not be extracted to help us further investigate your issue? Thanks in advance.
Code: Select all
PdfDocument pdf = new PdfDocument();
pdf.LoadFromFile("20180908.pdf.pdf");
List<Image> ListImage = new List<Image>();
for (int i = 0; i < pdf.Pages.Count; i++)
{
    ListImage.Add(pdf.SaveAsImage(i, PdfImageType.Bitmap,150,150));
    ListImage[i].Save(string.Format(@"image -{0}.jpg", i), ImageFormat.Jpeg);
}

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Sep 13, 2018 6:42 am

Hello,

Greetings from E-iceblue.
Could you let us know how is the issue going? Thanks in advance for your valuable feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1536
Joined: Wed Apr 25, 2018 3:20 am

Thu Mar 12, 2026 7:46 am

It usually happens if the PDF has complex layers or if the memory heap is getting capped during the loop.
Have you tried checking if the PageCount is being read correctly before the conversion starts? Sometimes the index gets tripped up if there are empty pages or non-standard compression. If you're just trying to verify which pages are 'readable' vs. 'corrupt' to narrow down the bug, I've used https://www.thetoolapp.com/extract-selected-pages-from-pdf/ to pull out the problematic ranges and see if they open fine elsewhere. It's a quick way to see if the issue is with the PDF file itself or just the library's rendering engine.

Skylar31
 
Posts: 15
Joined: Mon Oct 13, 2025 8:37 am

Return to Spire.PDF