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 2010/05/09 19:58:47 UTC

[jira] Resolved: (PDFBOX-563) Class Cast thrown when merging PDF's

     [ https://issues.apache.org/jira/browse/PDFBOX-563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler resolved PDFBOX-563.
---------------------------------------

    Fix Version/s: 1.2.0
       Resolution: Fixed

This issue is solved with solving PDFBOX-724. Works fine with the current trunk version (see attachment).

> Class Cast thrown when merging PDF's
> ------------------------------------
>
>                 Key: PDFBOX-563
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-563
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 1.0.0
>         Environment: Windows Vista 64/Java6
>            Reporter: Yonas Jongkind
>             Fix For: 1.2.0
>
>         Attachments: PDFBOX563-TestFax_merged.pdf, TestFax_56972.pdf, TestFax_56974.pdf, TestFax_56976.pdf
>
>
> When merging PDF's with the code:
> 			PDFMergerUtility pm = new PDFMergerUtility();
> 			File destPdf = File.createTempFile("TestFax_", ".pdf");
> 			pm.setDestinationFileName(destPdf.getAbsolutePath());
> 			for (File pdfFile:pdfFiles) {
> 				pm.addSource(pdfFile);
> 			}
> 			try {
> 				pm.mergeDocuments();
> 				return PDDocument.load(destPdf);
> 			} catch (COSVisitorException e) {
> 				LoggerFactory.getLogger(getClass()).error("Merging PDF's", e);
> 			}
> I get the exception:
> 10:44:09.511 [Thread-6] ERROR midwifemate.client.ui.PrintDialog$7 - null
> java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSObject
> 	at org.apache.pdfbox.util.PDFMergerUtility.cloneMerge(PDFMergerUtility.java:438) [classes/:na]
> 	at org.apache.pdfbox.util.PDFMergerUtility.cloneMerge(PDFMergerUtility.java:475) [classes/:na]
> 	at org.apache.pdfbox.util.PDFMergerUtility.cloneMerge(PDFMergerUtility.java:433) [classes/:na]
> 	at org.apache.pdfbox.util.PDFMergerUtility.appendDocument(PDFMergerUtility.java:227) [classes/:na]
> 	at org.apache.pdfbox.util.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:134) [classes/:na]
> 	at com.selene.mm.model.fax.Fax.getPdfForFaxing(Fax.java:254) [classes/:na]
> 	at com.selene.mm.model.fax.Fax.getPdfForPrinting(Fax.java:162) [classes/:na]
> 	at midwifemate.client.ui.PrintDialog$7.run(PrintDialog.java:415) [classes/:na]
> 	at midwifemate.ui.util.JProgressPane$1$1.run(JProgressPane.java:51) [classes/:na]
> 	at java.lang.Thread.run(Thread.java:619) [na:1.6.0_10-rc2]
> PDF's attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.