Arthur Blake created PDFBOX-2569:
------------------------------------

             Summary: COSNumber fails to parse numbers like "+018" in JRE <= 1.6
                 Key: PDFBOX-2569
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2569
             Project: PDFBox
          Issue Type: Bug
          Components: Parsing
    Affects Versions: 1.8.8
         Environment: JRE 1.6 and below.
            Reporter: Arthur Blake
            Priority: Minor
             Fix For: 1.8.8


Occasionally I encounter PDFs that have COSNumber's encoded with a preceding 
plus sign, like "+018" "+1" etc. This is a valid number representation, 
according to PDF 32000-1:2008 section 7.3.3.

COSNumber fails to parse these on JDK 1.6 and below. JDK 1.7 and above does not 
have the problem because Long.parseLong parses these correctly (in JDK 1.6 and 
below the plus sign would causes a NumberFormatException.)

I patched COSNumber with a simple fix on 1.8.8 and and verified that the fix 
worked against the affected PDFs. The bug exists in later versions of PDFBox, 
including the trunk. I will attach SVN patches for 1.8.8 and the trunk.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to