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

convertToImage includes "ghost" annotation outlines

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.7, 2.0.0
    • 1.8.8, 2.0.0
    • Rendering
    • Windows 7, Eclipse Helios SR2

    Description

      When using PDPage.convertToImage() to export PNG files of pages with annotations on them, "ghost" outlines of the annotations sometimes appear on the generated image. The outlines do not correspond to the location of the annotations. See the attached files.

      Code used:

      String inputFilePath = "C:/Gilad/input/3 Pages from batch_sequences.pdf";

      PDDocument doc = PDDocument.load(inputFilePath);

      for (int p=0; p<doc.getNumberOfPages(); p++)

      { PDPage page = (PDPage) doc.getDocumentCatalog().getAllPages().get(p); BufferedImage bImg = page.convertToImage(); String imagePath = FilenameUtils.getFullPath(inputFilePath) + "PAGE"+ Integer.toString(p) + ".png"; File yourImageFile = new File(imagePath); ImageIO.write(bImg,"png",yourImageFile); }

      Attachments

        1. 3 Pages from batch_sequences.pdf
          95 kB
          Gilad Denneboom
        2. PAGE0.png
          28 kB
          Gilad Denneboom
        3. PAGE1.png
          124 kB
          Gilad Denneboom
        4. PAGE2.png
          102 kB
          Gilad Denneboom

        Activity

          People

            lehmi Andreas Lehmkühler
            giladd Gilad Denneboom
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: