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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TIEBitmap.Read('SomePDF.pdf') max. pixels

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Fellafoo Posted - Oct 15 2023 : 10:03:10
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
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 15 2023 : 21:03:37
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
Fellafoo Posted - Oct 15 2023 : 10:53:25
*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