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

Using new PDPixelMap() results in black image in PDF

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.4
    • Fix Version/s: 1.8.5
    • Component/s: Rendering
    • Labels:
      None

      Description

      PDPixelMap.createImageStream() makes the assumption that BPC is 8. This is not always correct, and it results in the weird effects described here:
      https://stackoverflow.com/questions/15131067/pdfbox-issues-when-creating-pdf-from-bmp
      https://stackoverflow.com/questions/19422156/converting-printable-to-pdf

      I can confirm this by using GIF files. It happens both with bitonal and color GIF files. I have fixed it by using some of my code from the trunk from LosslessFactory.createFromImage(). That code is slower and longer, but is safer because it avoids making assumptions about the low level data, as in the line with "rgbImage.getData().getDataElements()".

      I will also uncomment the "new PDPixelMap" segment in the ImageToPDF examples.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tilman Tilman Hausherr
                Reporter:
                tilman Tilman Hausherr
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: