You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2017/06/18 13:12:01 UTC

[jira] [Resolved] (PDFBOX-3536) IOException "Invalid dictionary, found: 'r' but expected: '/' at offset 1148" on a valid PDF

     [ https://issues.apache.org/jira/browse/PDFBOX-3536?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-3536.
----------------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0
                   2.0.7

There was already an end of COSString detection in place. But it looked for another COSObject in the next line only. I've extended it to take the end of the COSDictionary as valid end for the previous COSString as well. Now, everything works fine.

[~sevaa] thanks for the report, [~tilman] thanks for the analysis




> IOException "Invalid dictionary, found: 'r' but expected: '/' at offset 1148" on a valid PDF
> --------------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3536
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3536
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.3
>         Environment: Windows 7 x64, JVM 1.8.0_101
>            Reporter: Seva Alekseyev
>            Assignee: Andreas Lehmkühler
>             Fix For: 2.0.7, 3.0.0
>
>         Attachments: resulprovao.pdf, UnknownDirObject.pdf
>
>
> On the attached file, which loads fine with Adobe Reader, the PDDocument.load() methpod throws the following error:
> java.io.IOException: Unknown dir object c='>' cInt=62 peek='>' peekInt=62 at offset 1196
> 	at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:982)
> 	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:153)
> 	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryNameValuePair(BaseParser.java:277)
> 	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:210)
> 	at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:885)
> 	at org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:757)
> 	at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:726)
> 	at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:657)
> 	at org.apache.pdfbox.pdfparser.COSParser.parseTrailerValuesDynamically(COSParser.java:2092)
> 	at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:203)
> 	at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:252)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:957)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:913)
> 	at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:861)
> 	at Temp.PDFTemp.App.main(App.java:19)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org