pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Bridges (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PDFBOX-469) q command not supported
Date Wed, 13 May 2009 04:04:45 GMT

    [ https://issues.apache.org/jira/browse/PDFBOX-469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708747#action_12708747
] 

Sean Bridges commented on PDFBOX-469:
-------------------------------------

Do you need more info to see if the pdf file is invalid?  I can't give you the file, but I
can give you snippets of it as above.

Even if the file is invalid, it may be good to skip the "q" command to be more robust in the
face of invalid pdf's.

> q command not supported
> -----------------------
>
>                 Key: PDFBOX-469
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-469
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 0.8.0-incubator
>            Reporter: Sean Bridges
>
> This is with svn version 773978
> I have several files which fail with sections like,
> endobj
> 187 0 obj
> <</ProcSet[/PDF/Text]
> /Font<</F0 7 0 R
> /F1 12 0 R
> >>
> /XObject<<>>
> >>
> endobj
> q
> 3 0 obj
> <</CreationDate (D:20050222175042)
> /Producer (PDFlib 3.02 \(ActiveX/Win32\))
> >>
> endobj
> They fail due to the "q" line.  I think this is a directive to save the current graphics
state, as described in 4.3.1 of the PDF Reference, V 1.7
> The exception stack trace is,
> Caused by: java.io.IOException: Error: Expected an integer type, actual='q'
> 	at org.apache.pdfbox.pdfparser.BaseParser.readInt(BaseParser.java:1197)
> 	at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:459)
> 	at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:169)
> 	at message_analyzer.extractor.PDFExtractor.getContent(PDFExtractor.java:32)
> Adding the code,
>         else if(peekedChar == 'q' || peekedChar == 'Q') {
>             pdfSource.read();
>             skipSpaces();         
>         }
> around line 434 in the parseObject() method of PDFParser seems to fix it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message