You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2018/05/16 14:38:00 UTC
[jira] [Comment Edited] (PDFBOX-4222) PDFMergerUtility:
java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be
cast to org.apache.pdfbox.cos.COSNumber
[ https://issues.apache.org/jira/browse/PDFBOX-4222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477510#comment-16477510 ]
Tilman Hausherr edited comment on PDFBOX-4222 at 5/16/18 2:37 PM:
------------------------------------------------------------------
There's an error in the page labels number tree... the array should be [ number, dictionary, number, dictionary, number, dictionary ] but it is [ number, dictionary, number, dictionary, dictionary ].
{noformat}
/PageLabels << /Nums [ 4 << /S /D >> 52 << /St 49 /S /D >> << /St 49 /S /D >> ] >>
{noformat}
Of course a ClassCastCxception is a no-no.
was (Author: tilman):
There's an error in the page labels number tree... the array should be [ number, dictionary, number, dictionary, number, dictionary ] but it is [ number, dictionary, number, dictionary, dictionary ].
{noformat}
/PageLabels << /Nums [ 4 << /S /D >> 52 << /St 49 /S /D >> << /St 49 /S /D >> ] >>
{noformat}
> PDFMergerUtility: java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSNumber
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-4222
> URL: https://issues.apache.org/jira/browse/PDFBOX-4222
> Project: PDFBox
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.0.9
> Environment: Ubuntu 14.04 and Windows 7
> Reporter: Eduard von Feek
> Priority: Major
>
> Given a problematic PDF, there can be ClassCastException when merging two PDFs, causing the merge to fail.
>
> Problematic example PDF: [https://bibliothek.wzb.eu/pdf/2001/ii01-303.pdf]
>
> Provoking command line:
> {code:java}
> java -jar pdfbox-app-2.0.9.jar PDFMerger ii01-303.pdf ii01-303.pdf out.pdf{code}
>
> Stacktrace:
> {code:java}
> Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSNumber
> at org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:504)
> at org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:263)
> at org.apache.pdfbox.tools.PDFMerger.merge(PDFMerger.java:70)
> at org.apache.pdfbox.tools.PDFMerger.main(PDFMerger.java:49)
> at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:81){code}
--
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