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 2012/05/18 18:51:08 UTC
[jira] [Closed] (PDFBOX-469) q command not supported
[ https://issues.apache.org/jira/browse/PDFBOX-469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andreas Lehmkühler closed PDFBOX-469.
-------------------------------------
Resolution: Won't Fix
Assignee: Andreas Lehmkühler
The q command support works well as Daniel already stated.
The culprit is a malformed pdf. According to the pdf specs nothing should appear between "endobj" and an objekt number like "3 0 obj". As we don't have a sample pdf to check if the current version is more lenient than 0.8.0-incubating I closed the issue.
> 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
> Assignee: Andreas Lehmkühler
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira