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
 Show the pages of a PDF file as thumbnails?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Dec 24 2016 :  22:21:58  Show Profile  Reply
Hello!

Which is the FASTEST method to show the pages of a PDF file as thumbnails in a TImageEnMView?

I would have to load the page images into a TIEMultiBitmap, then I need the page images to show as thumbnails in several different TImageEnMView instances (not at the same time of course but consecutively).

xequte

38610 Posts

Posted - Dec 25 2016 :  03:55:30  Show Profile  Reply
Hi Peter

Assuming you are using the WPViewPDF plug-in then why not use ImageEnMView1.MIO.LoadFromFile(...);

That will load all pages as thumbnails.

You can set ImageEnMView1.StoreType := ietThumb; to reduce memory overhead.




Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 25 2016 :  12:12:21  Show Profile  Reply
Thanks, I will consider buying the plug-in.

But another question:

I have filled a iexBitmaps.TIEMultiBitmap with Bitmaps. Now how can I show these Bitmaps in multiple TImageEnMView controls?
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 25 2016 :  13:22:07  Show Profile  Reply
OK, it's very easy:

ImageEnMView1.AssignEx(ThisMultiBitmap);
ImageEnMView2.AssignEx(ThisMultiBitmap);
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 27 2016 :  06:30:52  Show Profile  Reply
Hi Nigel,

I've purchased the WPViewPDF plug-in for 59 Euro.

It takes 35 seconds (!!!) to load the page thumbnails from a 219 pages PDF file!!!

This is unusable! Is there a way to optimize this? If not I'll ask for a refund.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 27 2016 :  09:17:22  Show Profile  Reply
Try
ImageEnMView1.LoadFromFileOnDemand(FileName);
this will be much faster than LoadFromFile because all the frames are loaded as needed, not all at once.

If that is not fast enough for you, then set the ImageEnMView1.StoreType := ietThumb or ietFastThumb to load a thumbnail rather than the normal image. To display the full frame in ImageEnView1 instead of the thumbnail use:
procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin
  ImageEnView1.IO.Params.ImageIndex := idx;
  ImageEnView1.IO.LoadFromFile(ImageEnMView1.MIO.Params[idx].FileName);
  ImageEnView1.Update;
end;

If you are using ietFastThumb then you should significantly increase the ImageCacheSize to something larger, such as 200.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 27 2016 :  12:12:14  Show Profile  Reply
Hi Nigel,

thank you for your advice, but it is still too slow for my specific purpose.
And even when I set the second parameter Append to True the scrolling back and forth through the thumbnails is still a pain.
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 27 2016 :  12:34:18  Show Profile  Reply
Aside from that: Is it possible to fill the ImageEnMView1 very fast with fake (empty) thumbnails, let's say a few hundred in 0.1 seconds? That could help me with another approach.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 27 2016 :  12:49:13  Show Profile  Reply
I am not Nigel. I am a developer just like you.

As far as the speed, did you try setting ImageEnMView1.StoreType := ietFastThumb and set the ImageEnMView1.ImageCacheSize := 300? If this is still too slow, I do not believe there is a faster way to do this because the component is using a thread to load the frames and only loads frames as they are required... when they become visible. I also do not think any other thumbnail component will be faster.

As an alternative to using thumbnails take a look at the PDFImageEn Demo that shipped with the wpcubed_pdf_plugin. This uses buttons to select the previous and next frames and will be much faster the multi demo. If that is not satisfactory I have run out of suggestions.

How big are the images you are loading?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

PeterPanino

933 Posts

Posted - Dec 27 2016 :  14:08:35  Show Profile  Reply
Hi Bill,

sorry for having mistaken you for Nigel and thank you for your comments!

In fact, I have developed myself a method to load the thumbnails for the 219 pages PDF I use for testing in 5 seconds, where the plugin takes 35 seconds! What I hoped was that the plugin would be faster than my method but in fact, it is much slower.

I have set the ImageCacheSize to 500 and StoreType to ietThumb (as I need to resize the thumbnails later on).

For my purpose, I don't need to show an enlarged image of a thumbnail, I just need the thumbnails from the PDF pages.

What I couldn't figure out yet was how to use multi-threading to speed up the rendering of my PDF pages into bitmaps.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: