Tuesday, November 15, 2011

Cut margins for PDF file to ease reading on Kindle DX

That works best for me is: pyPdf + custom script.

Description: just specify how much should be cropped. No huge difference in size of result PDF.
Install pyPdf module: "sudo yum install pyPdf"(Fedora) or "sudo apt-get install python-pyPdf"(Ubuntu)

Save scripts to "pdf_crop.py"
Usage:
"-m" mean  margin = "left top right bottom"
Examples:
python pdf_crop.py -m "25 30 7 25" -i progit.pdf
python pdf_crop.py -m "-5 0 -5 0" -i java_concurrency_in_practice.pdf


Consider also: calibre (in ubuntu repo), k2pdfopt, PaperCrop, and pdfread.

Pdfcop is useful tool by means of it I could easily read PDFs on it. It removes margins/borders of PDF.
This tool is not ideal - it always increase size of document in 2 till 100 times, even ones from 3Mb to 540Mb.

On Fedora:
sudo yum install texlive-utils
usage:
pdfcrop input.pdf output.pdf

Ubuntu users could try.

Also consider PDFEdit application
sudo yum install pdfedit
or
sudo apt-get install pdfedit

Example of cut is here , but I failed to use it.

Additional tools that could come in handy are here.

No comments:

Post a Comment