Save preview of page into the file - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Save preview of page into the file

Save preview of page into the file 4 years 3 weeks ago #7528

  • petr.sklenicka
  • petr.sklenicka's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • 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 4 years 3 weeks ago #7529

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
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