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

Page render without barcode

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.7, 1.8.8, 1.8.9, 1.8.10
    • 1.8.10, 2.0.0
    • PDModel
    • None
    • Ubuntu Linux, Java 8

    Description

      I have tryed this code:

              try {
                  PDDocument doc = PDDocument.load(f);
                  PDPage page = (PDPage) doc.getDocumentCatalog().getAllPages().get(0);
                  BufferedImage image;
                  image = page.convertToImage();
                  File outputfile = new File("/home/daniel/image.png");
                  ImageIO.write(image, "png", outputfile);
              } catch (IOException ex) {
                  Logger.getLogger(Impresora.class.getName()).log(Level.SEVERE, null, ex);
              }
      

      Using the PDF attached

      And get the PNG attached

      In the rendering process I get the following error... in the 'convertToImage()' call

      2014-11-14 13:56:12,592 WARN [org.apache.pdfbox.util.PDFStreamEngine] - <java.lang.ArrayIndexOutOfBoundsException>
      java.lang.ArrayIndexOutOfBoundsException
          at java.lang.System.arraycopy(Native Method)
          at org.apache.pdfbox.pdmodel.graphics.xobject.PDInlinedImage.createImage(PDInlinedImage.java:218)
          at org.apache.pdfbox.util.operator.pagedrawer.BeginInlineImage.process(BeginInlineImage.java:69)
          at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:557)
          at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:268)
          at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:235)
          at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:215)
          at org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:139)
          at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:801)
          at org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:732)
      

      One for each of the 4 barcodes in PDF file

      As you can see, te page is rendered OK but without any barcode

      How could I render completily OK?

      Attachments

        1. image.png
          92 kB
          Daniel Egea
        2. iris2_4943659641078733308_unc.pdf
          155 kB
          Tilman Hausherr
        3. iris2_4943659641078733308.pdf
          14 kB
          Daniel Egea

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tilman Tilman Hausherr
            degea Daniel Egea
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment