[
https://issues.apache.org/jira/browse/PDFBOX-3684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15862857#comment-15862857
]
Maruan Sahyoun commented on PDFBOX-3684:
----------------------------------------
Could you please add the merged document to this issue if you believe it was
correct. As outlined above you can't merge an XFA based PDF. 1.8.x wasn't able
to do that. We improved the handling in 2.x to make it clear that you can't
merge it. 1.8.x might have been able to generate a PDF but this wouldn't be a
correct one. And doing a quick test here 1.8.13 will have an
{{java.lang.StackOverflowError}}
> PDF box crashes on mal-formed files
> -----------------------------------
>
> Key: PDFBOX-3684
> URL: https://issues.apache.org/jira/browse/PDFBOX-3684
> Project: PDFBox
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.0.4
> Reporter: Andrii Radistao
> Attachments: certificate-of-analysis.pdf, questionario-sulle.pdf,
> radistao-pdfbox-merge-bug.zip
>
>
> I supply 2 PDF files (_certificate-of-analysis.pdf_ and
> _questionario-sulle.pdf_) which cause an exception if i try to merge them
> using {{PDFMergerUtility}}.
> I've implemented code examples which run to the exceptions:
> https://bitbucket.org/radistao/pdfbox-merge-bug/
> or just take the same sources from the attached
> [radistao-pdfbox-merge-bug.zip|https://issues.apache.org/jira/secure/attachment/12852256/radistao-pdfbox-merge-bug.zip]
> Those 2 files are included into the repository ({{test/resources/}}).
> Error stack trace for _certificate-of-analysis.pdf_:
> * using {{addSource()}}:
> {quote}java.lang.StackOverflowError
> at java.util.HashMap.hash(HashMap.java:338)
> at java.util.HashMap.containsKey(HashMap.java:595)
> at java.util.HashSet.contains(HashSet.java:203)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.addObjectToWrite(COSWriter.java:472)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromArray(COSWriter.java:927)
> at org.apache.pdfbox.cos.COSArray.accept(COSArray.java:515)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1061)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> {quote}
> * using {{appendDocument()}}
> {quote}org.apache.pdfbox.cos.COSDocument finalize
> WARNING: Warning: You did not close a PDF Document
> org.apache.pdfbox.cos.COSDocument finalize
> WARNING: Warning: You did not close a PDF Document
> org.apache.pdfbox.cos.COSDocument finalize
> WARNING: Warning: You did not close a PDF Document
> org.apache.pdfbox.cos.COSDocument finalize
> WARNING: Warning: You did not close a PDF Document
> org.apache.pdfbox.cos.COSDocument finalize
> WARNING: Warning: You did not close a PDF Document
> java.lang.StackOverflowError
> at
> org.apache.pdfbox.pdfwriter.COSWriter.getObjectKey(COSWriter.java:892)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.writeReference(COSWriter.java:1175)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromArray(COSWriter.java:928)
> at org.apache.pdfbox.cos.COSArray.accept(COSArray.java:515)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1061)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> at
> org.apache.pdfbox.pdfwriter.COSWriter.visitFromDictionary(COSWriter.java:1020)
> {quote}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]