logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Suriya Prakash  
#1 Posted : Monday, February 2, 2026 1:34:25 AM(UTC)
Suriya Prakash

Rank: Newbie

Groups: Registered
Joined: 12/29/2025(UTC)
Posts: 7
India
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=sharing

In the above link I have attached the PDF Samples and their exception images for your reference.
Andrey Varaksa  
#2 Posted : Tuesday, March 3, 2026 3:14:07 AM(UTC)
Andrey Varaksa

Rank: Newbie

Groups: Registered
Joined: 3/3/2026(UTC)
Posts: 2
Russian Federation

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
Users browsing this topic
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.