graphics-samples icon indicating copy to clipboard operation
graphics-samples copied to clipboard

black border around content

Open codingjeremy opened this issue 5 years ago • 1 comments

Issue by 2ndGAB Wednesday Jan 17, 2018 at 12:33 GMT Originally opened as https://github.com/googlesamples/android-PdfRendererBasic/issues/19


Hello, I'm trying to use PDFRenderer to convert a PDF file generated by the Android' PrintManager Below is this generated pdf file which seems perfectly correct. TestPrint.pdf And here is the code I use to convert this file in a bitmap.

    mCurrentPage = mPdfRenderer.openPage(index);

    int width = (int)(203.0 / 72.0 * mCurrentPage.getWidth() + 0.5);
    int height = (int)(203.0 / 72.0 * mCurrentPage.getHeight() + 0.5);

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

    mCurrentPage.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_PRINT);

And below is the generated Bitmap. could you please tell me where does this 80 pixels wide black border comes from? screenshot_19700129-125550

codingjeremy avatar Sep 06 '19 17:09 codingjeremy

Any update for this ?

nikh-06 avatar May 04 '22 13:05 nikh-06