8

I have a couple of PDFs and DJVU documents that I want to read on an ereader (namely, Kobo Touch). However, the size of the pages differ, between cover and actual content, and even between two different content pages, and what my ereader does is use the size of the first page as the "template" for the viewport size for all my documents. It means that if the first page is smaller, it will display only a small part of the next (bigger) pages, corresponding to the size of the first page. If the first pages is larger, then the other smaller pages will be tiny on a corner of the screen.

In other words, how can I scale all pages in a PDF/DJVU document to the same size (preferably the largest size among the pages in the document)?

PS: The files are mainly scanned scientific papers, in DJVU format, though I have to convert them to PDF in order to read them in my ereader.

1

There is a program called jPdftweak which will let you scale pdf pages to whatever size you would want. You can set the parameters for the conversion to the larger page size and jPdftweak will scale all the pages in the file in accordance with the settings you have made. jPdftweak is a cross-platform, free Java program.

  • Can you use this Java program and still pre-flight the PDF afterwards for commercial print quality production? – maxwell Oct 17 '14 at 19:26
  • I have done so but your mileage may vary. – user26732 Oct 19 '14 at 4:03
1

If your ebook reader supports EPUB you might be better of extracting the images from the PDF and DjVu files and creating EPUB files from the resized images.

This of course depends on the handling of larger-then-screen images on your reader, if that is different for EPUB than for images embedded in PDF, then of course you should target the better supported format (with regards to zooming and panning). A series of images in an EPUB file are easier to extract than the corresponding images from a PDF stream. So the handling on your ebook reader should be faster. At least on the systems I tested that is the case ( Sony PRS-700, Sony PRS-T1, Cybook Odyssey HD).

For the actual extraction, scaling and recombination I use a Python based program on Linux that drives standard tools like pdfimages and ddjvu for the extraction, imagemagick for the scaling/conversion, and does the recombination into EPUB itself.

Of course the last step could easily be changed to the recombination into a PDF file using reportlab.

  • Thank you for the suggestions, but I did say what ereader I have (Kobo Touch, for the record), which doesn't allow panning in EPUBs, and doesn't support DJVU at all, so I'm stuck with PDF. I will check out your links to see if they acomplish what I'm looking for. – andrepd Mar 6 '14 at 20:48
  • @andrepd Sorry I have overlooked that. I am not familiar with the Kobo. I am used to not being able to pan the images in an epub, unless you zoom in (standard they images are fitted, and for panning they have to be larger than screen size). If you try one by hand and get it to work then automating things by calling the programs from Python (or some other scripting language you know) should not be difficult. – Anthon Mar 6 '14 at 21:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.