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

convertToImage seems to invert colors

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0-incubator
    • Fix Version/s: 1.2.0
    • Component/s: Parsing
    • Labels:
      None
    • Environment:
      any

      Description

      The pdfbox support team asked me to post this message on this forum so attachments could be seen

      I have a pdf document that has a white background with black text. It
      appears after I make the call to convertToImage the colors are reversed. A
      black background with white text

      pdDocument = PDDocument.load(new ByteArrayInputStream(aContent));
      List<PDPage> documentPageList = pdDocument.getDocumentCatalog().getAllPages();
      for(int i=0; i<documentPageList.size(); ++i) {
      PDPage aPage = documentPageList.get;
      for (int x=1; x < 14; x++) {
      BufferedImage tempImage = convertToImage(x, (2 * 72),aPage);
      ImageIO.write(tempImage,"jpeg", new File("c:
      tmp
      page-" + x + ".jpeg"));
      }
      }

        Attachments

        1. original.pdf
          22 kB
          Scott Tyriver
        2. page-8.png
          35 kB
          Scott Tyriver
        3. PDFBOX584-original1.png
          116 kB
          Andreas Lehmkühler

          Issue Links

            Activity

              People

              • Assignee:
                lehmi Andreas Lehmkühler
                Reporter:
                styriver Scott Tyriver
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: