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

TOPIC:

Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap 5 years 8 months ago #14113

  • ericatudn
  • ericatudn's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 1
Hello.
Please forgive my bad English.
When calling Page.RenderToBmp(Bitmap bitmap, Matrix mat), a weird bitmap was created, see attachment "weird_bitmap.jpg".
The origin PDF files is "test.PDF" (page 2), see attachment. This file is actually from your test project.
My java code:

//=============================================
private PDFLayoutView m_view = null;
private Document m_doc = null;
...
private Bitmap getBitmap()
{
int pageNo = m_view.PDFGetCurrPage();

float x = 0;
float y = m_doc.GetPageHeight(pageNo);

Matrix matrix = new Matrix(1, -1, x, y);

int width = (int) m_doc.GetPageWidth(pageNo);
int height = (int) m_doc.GetPageHeight(pageNo);

Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);

m_doc.GetPage(pageNo).RenderToBmp(bitmap, matrix);

matrix.Destroy();

return bitmap;
}
//=============================================

Thank you very m

This browser does not support PDFs. Please download the PDF to view it: Download PDF

uch.
Attachments:

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

Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap 5 years 7 months ago #14163

  • ericatudn
  • ericatudn's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 1
Hello, any advice for my question?
Thank you very much.

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

Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap 5 years 7 months ago #14165

  • support
  • support's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 692
  • Thank you received: 59
The following user(s) said Thank You: ericatudn

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

  • Page:
  • 1
Powered by Kunena Forum