You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Timo Boehme (JIRA)" <ji...@apache.org> on 2018/08/27 15:42:00 UTC
[jira] [Resolved] (PDFBOX-4301) ClassCastException in
PDExtendedGraphicsState
[ https://issues.apache.org/jira/browse/PDFBOX-4301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timo Boehme resolved PDFBOX-4301.
---------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0 PDFBox
2.0.12
> ClassCastException in PDExtendedGraphicsState
> ---------------------------------------------
>
> Key: PDFBOX-4301
> URL: https://issues.apache.org/jira/browse/PDFBOX-4301
> Project: PDFBox
> Issue Type: Bug
> Components: Parsing
> Affects Versions: 2.0.11
> Reporter: Timo Boehme
> Assignee: Timo Boehme
> Priority: Minor
> Fix For: 2.0.12, 3.0.0 PDFBox
>
>
> The method PDExtendedGraphicsState.getFloatItem contains a non checked cast to COSNumber for a dictionary object. In a specific journal PDF document I get the following exception:
> {noformat}
> at org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState.getFloatItem(PDExtendedGraphicsState.java:591)
> at org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState.getStrokingAlphaConstant(PDExtendedGraphicsState.java:482)
> at org.apache.pdfbox.pdmodel.graphics.state.PDExtendedGraphicsState.copyIntoGraphicsState(PDExtendedGraphicsState.java:130)
> at org.apache.pdfbox.contentstream.operator.state.SetGraphicsStateParameters.process(SetGraphicsStateParameters.java:61)
> at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:848){noformat}
> because the PDF contains
> {noformat}
> /A4 <<
> /CA (1.0)
> /Type /ExtGState
> /ca (1.0)
> >>
> {noformat}
> where "(1.0)" is clearly wrong and should be "1.0".
> As this seems to be a more seldom error I would suggest to check dictionary object type before casting and returning "null" for wrong type (as it is done e.g. in PDExtendedGraphicsState.getFontSetting.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org