Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5553

PDFRenderer resulting image has black background

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.27
    • 2.0.28, 3.0.0 PDFBox
    • Rendering
    • None

    Description

      Using the attached PDF as the pdf, the resulting png has a black ground using the code below.  Opening this PDF in reader or chrome etc., the background is white.

      PDDocument pdDocument = PDDocument.load(pdf, MemoryUsageSetting.setupMixed(1024 * 1024 * 56));
      try {    BufferedImage image = new PDFRenderer(pdDocument).renderImageWithDPI(0, 300, ImageType.RGB);
          ImageIO.write(image, "png", new File("bad-black-background.png"));
      } finally {
          pdDocument.close();
      } 

      Attachments

        1. black-background.pdf
          45 kB
          Joseph Jezerinac

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              jezerinac Joseph Jezerinac
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: