Timo Boehme created PDFBOX-4301:
-----------------------------------
Summary: 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
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: [email protected]
For additional commands, e-mail: [email protected]