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

Rendering a single page to android.graphics.Bitmap

More
11 years 4 months ago - 11 years 4 months ago #8899 by Kin Chung
After the PDF is opened, I executed the code below:

float w = pdfReader.PDFGetDoc().GetPageWidth(0);
float h = pdfReader.PDFGetDoc().GetPageHeight(0);
float ih = 44 * getDensity();
float iw = ih / h * w;
Page page = pdfReader.PDFGetDoc().GetPage(0);
Bitmap bmp = Bitmap.createBitmap((int) iw, (int) ih, Bitmap.Config.ARGB_8888);
bmp.eraseColor(Color.WHITE);
page.RenderThumb(bmp);

However, the bmp object is still blank. Did I miss out something?
Last edit: 11 years 4 months ago by Kin Chung.
More
11 years 4 months ago - 11 years 4 months ago #8901 by Davide
Hi.
if you want to add the bitmap to the page you have to use:
Code:
page.RenderToBmp(Bitmap bitmap)
instead of :
Code:
page.RenderThumb(bmp);

For more info you can check the documentation and look at this knowledge-base article .
Last edit: 11 years 4 months ago by Davide.
Time to create page: 0.391 seconds
Powered by Kunena Forum