yanpas / pdfmerger Goto Github PK
View Code? Open in Web Editor NEWMerges pdfs and creates handy outline
License: GNU General Public License v3.0
Merges pdfs and creates handy outline
License: GNU General Public License v3.0
Trying to merge the attached single PDF file (no need to add a second file to merge in order to demonstrate the issue) with:
java -jar pdfmerger-1.2.jar choi17a.pdf out.pdf
I get:
Error: Error: can't convert to Destination COSArray{[COSNull{}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{1.0}]}
Stack trace:
java.io.IOException: Error: can't convert to Destination COSArray{[COSNull{}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{1.0}]}
at org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination.create(PDDestination.java:98)
at org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem.getDestination(PDOutlineItem.java:188)
at org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem.findDestinationPage(PDOutlineItem.java:230)
at yanpas.pdfmerger.Merger.addOutlines(Merger.java:23)
at yanpas.pdfmerger.Merger.appendDoc(Merger.java:62)
at yanpas.pdfmerger.Merger.addDocument(Merger.java:68)
at yanpas.pdfmerger.PdfMerger.main(PdfMerger.java:67)
This happens with both versions 1.0 and 1.2.
This is probably due to the fact the the PDF contains a bookmark, 'Choi_Appendix.pdf' that does not seem to be pointing anywhere - at least the viewers seems to ignore it.
As a temporary fix (workaround), eliminate bookmarks with empty targets from the PDFs you want to merge. For example, this version of the PDF in question, without the nowhere-pointing bookmark, works flawlessly:
Ignore bookmarks that look invalid, instead of choking on them. Issue a warning, but add them nonetheless, possibly with an empty (or default, if 'empty' is not an option) target.
sriperumbudur12.pdf
sriperumbudur12Supple.pdf
Trying to merge the two attached PDFs with
java -jar pdfmerger.jar sriperumbudur12.pdf sriperumbudur12Supple.pdf out.pdf
I get:
Processing sriperumbudur12.pdf
Processing sriperumbudur12Supple.pdf
File "sriperumbudur12Supple.pdf" seems to be non-pdf
java.io.IOException: File "sriperumbudur12Supple.pdf" seems to be non-pdf
at yanpas.pdfmerger.Merger.appendDoc(Merger.java:42)
at yanpas.pdfmerger.Merger.addDocument(Merger.java:69)
at yanpas.pdfmerger.PdfMerger.main(PdfMerger.java:33)
but sriperumbudur12Supple.pdf is a valid PDF file, as you can assure yourself by opening it in any viewer. At least my Acrobat Professional does not complain at all and displays it without problems.
Any hints?
Hello,
If the output PDF file is larger than 150MB, the merge will fail.
A cancel dialog box pops up on the screen.
But I have to work with such a large PDF.
please help me.
sincerely
Jane
Don't know how to say thank you without lunching a bug to do so, but cat'ing a bunch of PDFs while building an bookmark outline is something so simple and yet has been impossible to find!
Thank you
(PS I did find it quite difficult to follow the documentation to set up - I found myself reading the source to find the docs and pdfmerger executable in order to work out where to put and how to run the binary as intended.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.