Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.
This repository was archived by the owner on Sep 20, 2026. It is now read-only.

black border around content #17

Open

Description

@codingjeremy

Issue by 2ndGAB
Wednesday Jan 17, 2018 at 12:33 GMT
Originally opened as googlearchive/android-PdfRendererBasic#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

Activity

  1. added
    migrated googlesamples
    on Sep 18, 2019
  2. nikh-06 commented on May 4, 2022

    @nikh-06

    Any update for this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PdfRendererBasicmigrated googlesamples

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions