Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Faster way to generate thumbnails 10 years 3 months ago #5021

  • rtoshiro
  • rtoshiro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi,

We are creating thumbnails Bitmap using Page.RenderToBmp, but, to generate about 300 thumbs, it is taking a lot of time, even running in faster devices (+30 seconds)

Are there any way to improve it? We are using one thread to loop through m_doc.GetPageCount() and getting Page with m_doc.GetPage(int)
For each Page, we create the bitmap, erase it and fill it with RenderToBmp.
Even with no caching, no writing, just to create the object Bitmap and trowing it away.

We have tried to initiate more than one thread, but in that case, the second thread created blank bitmaps.

Thank you.
Best
T

Please Log in or Create an account to join the conversation.

Faster way to generate thumbnails 10 years 3 months ago #5022

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
try RenderThumb first, if return false, then using RenderToBmp
codes like:
if( RenderThumnb() )
{
}
else
{
  RenderToBmp();
}
RenderThumnb may return false, if the PDF file has no thumbnail image for each page.

Please Log in or Create an account to join the conversation.

Last edit: by .

Faster way to generate thumbnails 10 years 2 months ago #5044

  • rtoshiro
  • rtoshiro's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
But we are calling it in parallel with PDF reading, in another thread.
It returns false most of time and it is still taking too much time to render bitmap.

Thank you.
Best
T

Please Log in or Create an account to join the conversation.

Faster way to generate thumbnails 10 years 1 month ago #5721

  • honzamusil
  • honzamusil's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
Hi,
I have the same issue. I need to save bitmaps/thumbnails for whole pdf. approx. 60pages. But it takes around 30seconds to save one.
How do you generate bitmap for zoom, can I use the same method. Or can I access these bitmaps?

Thanks for help

Please Log in or Create an account to join the conversation.

Faster way to generate thumbnails 10 years 1 month ago #5722

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
save pages to sdcard?
it shall be slower than keep Bitmap objects, for this method need compress pixels data to png or jpeg file, and decompress when loading.

Please Log in or Create an account to join the conversation.

Faster way to generate thumbnails 10 years 1 month ago #5724

  • honzamusil
  • honzamusil's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 3
  • Thank you received: 0
I want to keep them in cache directory. I didn't start to safe them yet because creating take too much time. So I need to find better (quicker) way how to create all thumbnails. For now I'd have to wait approx 30minutes to generate all thumbnails and display them in a view

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum