Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      COSNumber.get() throws IOException 'Value is not an integer'.
      The method parameter was '-2e-006'.

      Is my PDF file wrong?
      I cannot upload my PDF file due to copyright. Sorry.

      java.io.IOException: Value is not an integer: -2e-006
      at org.apache.pdfbox.cos.COSNumber.get(COSNumber.java:96)
      at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1084)
      at org.apache.pdfbox.pdfparser.BaseParser.parseCOSArray(BaseParser.java:802)
      at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1011)
      at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:179)
      at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:292)
      at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1000)
      at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:543)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:184)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1069)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1036)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1007)
      at PDFBoxTest.main(PDFBoxTest.java:36)

      1. COSNumberTestCase.java
        0.3 kB
        Stanislav Oaserele
      2. cosnumber_patch.patch
        0.6 kB
        Stanislav Oaserele

        Activity

        Andreas Lehmkühler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Andreas Lehmkühler made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Andreas Lehmkühler [ lehmi ]
        Fix Version/s 1.7.0 [ 12316940 ]
        Resolution Fixed [ 1 ]
        Hide
        Andreas Lehmkühler added a comment -

        Stanislav provided me with a sample pdf via pm. It contains a float in an exponential format like the following

        /BBox[-8e-05 -8.28809 0.99992 8.28741]

        I added the patch and the testcase as proposed in revision 1244192.

        Thanks for the contribution!

        Show
        Andreas Lehmkühler added a comment - Stanislav provided me with a sample pdf via pm. It contains a float in an exponential format like the following /BBox [-8e-05 -8.28809 0.99992 8.28741] I added the patch and the testcase as proposed in revision 1244192. Thanks for the contribution!
        Hide
        Stanislav Oaserele added a comment -

        @Andreas
        Attaching file would be inappropriate due to copyrights.

        Show
        Stanislav Oaserele added a comment - @Andreas Attaching file would be inappropriate due to copyrights.
        Hide
        Andreas Lehmkühler added a comment -

        @Stanislav
        Can you provide us with a sample pdf? According to the specs conforming pdfs shall not use an exponential format for numbers.

        Show
        Andreas Lehmkühler added a comment - @Stanislav Can you provide us with a sample pdf? According to the specs conforming pdfs shall not use an exponential format for numbers.
        Stanislav Oaserele made changes -
        Field Original Value New Value
        Attachment cosnumber_patch.patch [ 12514334 ]
        Attachment COSNumberTestCase.java [ 12514335 ]
        Hide
        Stanislav Oaserele added a comment - - edited

        I had the same problem using PdfBox 1.6.0.

        java.io.IOException: Value is not an integer: -8e-05
        at org.apache.pdfbox.cos.COSNumber.get(COSNumber.java:96)
        at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1084)
        ...

        Patch and test case attached

        Show
        Stanislav Oaserele added a comment - - edited I had the same problem using PdfBox 1.6.0. java.io.IOException: Value is not an integer: -8e-05 at org.apache.pdfbox.cos.COSNumber.get(COSNumber.java:96) at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1084) ... Patch and test case attached
        Hiroshi Koyama created issue -

          People

          • Assignee:
            Andreas Lehmkühler
            Reporter:
            Hiroshi Koyama
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development