[
https://issues.apache.org/jira/browse/PDFBOX-3684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15873702#comment-15873702
]
Andrii Radistao edited comment on PDFBOX-3684 at 2/19/17 1:35 PM:
------------------------------------------------------------------
[~tilman]
sorry for the mess in the ticket.
i've checked _2.0.5-20170219.105958-197_ snapshot - looks like it works fine.
thanks.
Still have 2 questions before the ticket closing:
1) {{IOException}} like in _questionario-sulle.pdf_ with message in _can't
merge source document containing dynamic XFA form content_ - could we distinct
somehow the these kind of "expected" exceptions from other IOExceptions (like
file not found or permission denied)? I mean to create a custom exception type,
like _BadPdfContentException_. Because in case of such "expected" issues in PDF
we should notify a customer that the problem is exactly in PDF content, but not
in a file as a part of file system. May be this question should be moved to
separate thread/discussion
2) i have one file which is processed wrong in 1.8.13 version, but works fine
in 2.0.4 version (the content of destination PDF is mixed, one of two elements
lost it's own content an has a content from another box). should i supply a new
issue for 1.8 version, or this version won't be supported any more? (i wrote
this question to the mailing list, but guess, i did some mistake like used
wrong e-mail address cos there is no any answer)
Thanks
was (Author: radistao):
[~tilman]
sorry for the mess in the ticket.
i've checked _2.0.5-20170219.105958-197_ snapshot - looks like it works fine.
thanks.
Still have 2 questions before the ticket closing:
1) {{IOException}} like in _questionario-sulle.pdf_ with message in _can't
merge source document containing dynamic XFA form content_ - could we distinct
somehow the these kind of "expected" exceptions from other IOExceptions (like
file not found or permission denied)? Because in case of such "expected" issues
in PDF we should notify a customer that the problem is exactly in PDF content,
but not in a file as a part of file system. May be this question should be
moved to separate thread/discussion
2) i have one file which is processed wrong in 1.8.13 version, but works fine
in 2.0.4 version (the content of destination PDF is mixed, one of two elements
lost it's own content an has a content from another box). should i supply a new
issue for 1.8 version, or this version won't be supported any more? (i wrote
this question to the mailing list, but guess, i did some mistake like used
wrong e-mail address cos there is no any answer)
Thanks
> 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,
> questionario-sulle+SDE.pdf, radistao-pdfbox-merge-bug.zip,
> v1.8.13-PdfMergerAddSourceTest-questionario-sulle.pdf
>
>
> 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}
> Note: in version 1.8.13 (see
> https://bitbucket.org/radistao/pdfbox-merge-bug/branch/test/v1.8.13) file
> _questionario-sulle.pdf_ merged fine (see attached merge result
> [v1.8.13-PdfMergerAddSourceTest-questionario-sulle.pdf|https://issues.apache.org/jira/secure/attachment/12852259/v1.8.13-PdfMergerAddSourceTest-questionario-sulle.pdf]),
> but with just warnings:
> {quote}org.apache.pdfbox.pdfparser.PDFParser parseObject
> WARNING: expected='%%EOF' actual=''
> org.apache.pdfbox.pdfparser.XrefTrailerResolver setStartxref
> WARNING: Did not found XRef object at specified startxref position 0{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]