Patagames Software Support Forum
»
Pdfium.Net SDK
»
Bug Report & Technical Support
»
Crashed when try to render the PDF to Image using Render functionality
Rank: Newbie
Groups: Registered
Joined: 12/29/2025(UTC) Posts: 7  Location: Coimbatore Thanks: 2 times
|
Hello Team, We are trying to render the PDF Pages into image based on the DPI selected but as per the Render method which gets height and width we calculated this using the formula mentioned below. int targetWidth = (int)(page.Width / 72 * dpi); int targetHeight = (int)(page.Height / 72 * dpi);When we are trying to render a page in 1200 DPI we faced the crashing. https://drive.google.com/drive/f...nLJxJ_iuEUjo?usp=sharingIn the above link I have attached the PDF Samples and their exception images for your reference.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 3/3/2026(UTC) Posts: 2 
|
In GDI+, physical dimensions are limited to integers. This means you can only work with Bitmaps no larger than int.MaxValue (2147483647) bytes. In your examples, the resulting file sizes (calculated using the formula width * height * 4) are 2762099200 and 2401974080 for the files sample2.pdf and sample3.pdf, respectively. Naturally, this results in the exception 'A generic error occurred in GDI+.' in the bitmap.GetImage() function. For the file sample_1.pdf, this value is even larger: 5981454080. This also results in an exception in the FillRect function. Recommendations: 1. Reduce the DPI for the resulting file (currently it's 1200) 2. Split the page into sections and convert each section to an image separately A similar problem was discussed at this link: https://forum.patagames....functionality-as-Acrobat
|
|
|
|
|
|
Patagames Software Support Forum
»
Pdfium.Net SDK
»
Bug Report & Technical Support
»
Crashed when try to render the PDF to Image using Render functionality
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close