You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Shaun Kenny (JIRA)" <ji...@apache.org> on 2015/07/24 18:24:05 UTC

[jira] [Commented] (PDFBOX-2903) ClassCastException at PDFParser:667

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

Shaun Kenny commented on PDFBOX-2903:
-------------------------------------

Locally, I've replaced the code noted in the issue description with the following, and I am able to merge my PDF input streams without error:

COSBase baseObject = (COSBase)strmObj.getItem( COSName.TYPE );
COSName objectType = null;
if (baseObject instanceof COSString) {
    String baseObjectValue = ((COSString)baseObject).getString();
    objectType = COSName.getPDFName(baseObjectValue);
}
else
{
    objectType = (COSName)baseObject;
}

Unfortunately I am unable to attach the PDF that is causing the problem as it contains sensitive information.

> ClassCastException at PDFParser:667
> -----------------------------------
>
>                 Key: PDFBOX-2903
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2903
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 1.8.10
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>             Fix For: 1.8.11
>
>
> from "skenny" in the user mailing list:
> I'm using PDFMergerUtility to merge a number of PDF input streams and write
> them to an HTTP response output stream.  One of the PDFs is failing at line
> 667 in PDFParser:
> {code}
>     final COSName objectType = (COSName)strmObj.getItem( COSName.TYPE );
> {code}
> The result of getItem(COSName.TYPE) is a COSString (value "Metadata") and
> not a COSName.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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