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

TOPIC:

Save preview of page into the file 9 years 6 months ago #7528

  • petr.sklenicka
  • petr.sklenicka's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 36
  • Thank you received: 0
Hello,
there is a class PDFViewThumb in your library. I use this class for displaying previews of pages, but the rendering of the previews is a little bit slow.
Does your library support some function for saving a rendered preview into a .png, .jpeg or some other format? I would like to save rendered previews into a file and when the preview will be needed, there will be no need to render it again, but a saved image will be used.
Is there any functionality for this there in your library?


Best regards,
Petr

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

Save preview of page into the file 9 years 6 months ago #7529

  • nermeen
  • nermeen's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 962
  • Thank you received: 87
You can do something like:
Bitmap mBitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888);
page.RenderToBmp(mBitmap, new Matrix( scale, -scale, (float)0, (float) 200 ));
        
//save the created thumb into the file system
try {
    FileOutputStream fos = new FileOutputStream(thumbsPath);
    mBitmap.compress(CompressFormat.JPEG, 100, fos);
} catch (java.io.IOException e) {
}
        

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

  • Page:
  • 1
Powered by Kunena Forum