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
 ImageEn and PDFium Plugin

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
tmichalska Posted - Jun 30 2021 : 07:53:55
Hello,

I tested ImageEn 10.0.1 with the provided Trial-DCUs regarding the use of the PDFium plugin.

So far we are using the ImageEn WPCubed plugin for displaying PDF files in a TImageEnMView and also in a TImageEnView but we are interested in replacing it with the PDFium plugin.

For being able to switch the plugin there are some subjects I could not figure out via the Trial DCUs and the online help which does not seem to be completely up to date yet.
But maybe there are already solutions to it.

1. The help suggests loading a PDF file to a TImageEnMView via TImageEnMView.MIO.LoadFromFilePDF because the displayed size can be defined.
However, while using this method I had the problem with some PDF including several hundred pages that scrolling through it led to an out of memory exception at some point.
It seems that pages scrolled out of view are still kept in memory.
Using the TImageEnMView.LoadFromFileOnDemand method instead does seem to clear the memory of the pages scrolled out of view, but you cannot define a display size.
While checking this I did not change any properties of the TImageEnMView, so this memory behaviour must depend on which method for loading is used.
And the standard size is way to small, especially on scaled monitors, so the LoadFromFileOnDemand method cannot be used.
There are several reasons we cannot use TImageEnView.PDFViewer for displaying PDF in our case instead.

2. As far as I could figure out the displayed sizes while loading a PDF file via the PDFium plugin can only be set absolutely. It would be an advantage to being able to define
the size relatively as well since the page sizes of the PDF file loaded are not known in advance. The former mentioned WPCubed plugin for example provides the possibility to define
the relative size by assigning appropriate values to TIOParams.DPIX and TIOParams.DPIY right before loading the PDF. Setting these values using PDFium does not have any effect on this.

3. Is it possible via the PDFium plugin to extract a page of a PDF file as a metafile? This is vital for several use cases in our software.

Best regards,

Timo Michalska
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 30 2021 : 16:21:08
Hi Timo

Unfortunately, PDF support in ImageEn can be confusing because it is supported in different ways depending on the method and the plug-in, e.g. native exporting is used for outputting layers because it gives the most accurate result, but native loading is not available. When loading via plug-in, a rasterized image can be loaded or a full quality render. More info at:

https://www.imageen.com/help/File_Formats.html#PDF

If you see instances of the help file being inaccurate or confusing, let us know.


1. If you are using a TImageEnView.PDFViewer to load the PDF then attach it to the TImageEnMView to show the content:

  ImageEnMView1.AttachedImageEnView := ImageEnView1;

If you load the content directly into TImageEnMView, then the document is rasterized. You should definitely use LoadFromFileOnDemand to handle large images. When rasterizing, the default size should be the actual size (preferred size) for the PDF page, which should easily be high enough quality for thumbnails. Can you explain this issue in more detail?


2. When using PDFium in TImageEnView (or showing it in TImageEnMView when attached) the image is rendered at the display size. If you , e.g. if you zoom to 300% it should still be full quality.

Have you tried the PDF Viewer demo:

\Demos\Other\PDFViewer\PdfViewer.dpr


3. No, not as meta-file. Only as a PDF or a support image format.



Nigel
Xequte Software
www.imageen.com