- Posts: 14
- Thank you received: 1
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap
IP: 60.250.135.18
8 years 1 week ago #14113
by ericatudn
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 uch.
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 uch.
IP: 203.69.6.99
7 years 11 months ago #14163
by ericatudn
Replied by ericatudn on topic Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap
Hello, any advice for my question?
Thank you very much.
Thank you very much.
IP: 212.97.62.176
7 years 11 months ago #14165
by support
Replied by support on topic Page.RenderToBmp(Bitmap bitmap, Matrix mat) create weird bitmap
Try following this
www.radaeepdf.com/support/knowledge-base?view=kb&kbartid=98
Time to create page: 0.452 seconds