rbs90 / Hanser-book-downloader

Download of ebooks from hanser (auto-merge to one pdf)
2 stars 2 forks source link

Merging doesn't work #2

Open Mebus opened 7 years ago

Mebus commented 7 years ago

Hi!

I tried to download a book with it. It downloads all files to the tmp directory, but unfortunately it cannot merge them. I am using Fedora Linux 24.

This is the error message:

Exception in thread "main" java.io.IOException: expected='endstream' actual='' org.apache.pdfbox.io.PushBackInputStream@340afaf8 at org.apache.pdfbox.pdfparser.BaseParser.parseCOSStream(BaseParser.java:597) at org.apache.pdfbox.pdfparser.PDFParser.parseObject(PDFParser.java:566) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:187) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1071) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1038) at org.apache.pdfbox.util.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:186) at Main.main(Main.java:66)

Greetings

Mebus

Mebus commented 7 years ago

It turns out, that one of the downloaded PDF files was broken: number 7 of 10 files. Downloaded it manually and merged them using another software.

Maybe you could detect the error.

Mebus

rbs90 commented 7 years ago

Hi, is the error reproducable with an special ebook? Or was it only a random download fail?

I'm not completly sure if there is a easy way to detect a failed download.

Greetings, rbs