ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIEBitmap.Read('SomePDF.pdf') max. pixels
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Fellafoo

USA
52 Posts

Posted - Oct 15 2023 :  10:03:10  Show Profile  Reply
I've been using a different PDFium Component Suite because I need support for both Delphi 6 and RAD Studio 11. I need to convert PDF's of CAD drawings (i.e. 24" x 36", 30" x 42", etc.) to bitmaps. I was testing the conversion of a 24x36 sheet to various formats (bmp, gif, jpg, png, etc.) at dpi values ranging from 100 (~8.5 MP) to 700 (~423 MP).

Using the 32bit dll, the resolution maxes out around (~78 MP) or a BMP around 222 MB.
Using the 64bit dll, the resolution maxes out around (~423 MP) or a BMP around 1.18 GB.

To convert the PDF using WINSOFT's PDFium library, I make the following call to create a TBitmap.

Bmp := PDFium.RenderPage(0, 0, Width, Height, ro0, [], clWhite);


Then, to convert to any given format, I'll use ImageEn to write the bitmap. For example...

ieBmp := TIEBitmap.Create(Bmp);
ieBmp.Write(ImageName + IntToStr(DPI) + '_' + IntToStr(Width) + 'x' + IntToStr(Height) + '_' + IntToStr(Width * Height) + '.jpg', ioJPEG, nil);


In RAD Studio, I tried switching to ImageEn's implementation (iepdf64.dll) of PDFium and ran into a couple of issues.

01. If I activate the iepiPDFium plug-in, WINSOFT's PDFium fails to load the PDF file.

02. To avoid the conflict, I tried switching from WINSOFT to ImageEn to do the PDF conversion. For example...

ieBmp := TIEBitmap.Create();
ieGlobalSettings.PdfViewerDefaults.DPI := DPI; { 100 to 700 }
ieBmp.Read(PDFFlName);
ieBmp.Write(ImageName + IntToStr(DPI) + '_' + IntToStr(Width) + 'x' + IntToStr(Height) + '_' + IntToStr(Width * Height) + '.jpg', ioJPEG, nil);


However, any conversion above 500 (~216MP) or a BMP around 889 MB, fails to write. The read appears to work ok, and the width/height are correct in the debugger. So, I'm not sure why I'm running into this limitation using the second method.

I was doing these tests with ImageEn 11.4.5. I've not been able to do the tests with 12.5.0 due to an error I'm getting with RAD Studio 11.

MFM

Fellafoo

USA
52 Posts

Posted - Oct 15 2023 :  10:53:25  Show Profile  Reply
*UPDATE*

I was able to drop back to RAD Studio 10.4 Version 27.0.40680.4203 to test with ImageEn 12.5.0. After rerunning the tests, the size limit appears to be related to writing to ImageMagik formats (webp in particular). The other formats (bmp, gif, jp2, jpg, and png) were created at 100 - 700 dots per inch.

In addition, I did not run into the same problem with the WINSOFT conflict.

MFM
Go to Top of Page

xequte

38610 Posts

Posted - Oct 15 2023 :  21:03:37  Show Profile  Reply
Hi

Our current Beta now supports PDFium as far back as Delphi 7. You could probably get it to work in Delphi 6 with little effort (I just don't have a D6 test IDE). Email me for the update.

I can't speak to the conflict, perhaps something about the same exe initializing multiple instances of PDFium (though I cannot see why that would be an issue).

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: