Giter Club home page Giter Club logo

pdfmerger's People

Contributors

yanpas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdfmerger's Issues

java.io.IOException: File x.pdf seems to be non-pdf - but x.pdf is fine

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?

Bloody Cracking Bit of Code!!!

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.)

Error: Error: can't convert to Destination COSArray{[COSNull{}, COSFloat{0.0}, COSFloat{0.0}, COSFloat{1.0}]}

Attachment

choi17a.pdf

Description

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.

Reason

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.

Workaround

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:

choi17a.pdf

Proposed solution

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.