Kindify: Making PDFs readable on the @Amazon Kindle

Probably YOU too bought the kindle to read those pdfs that you having been stashing in your hard drive and wondering when you will get to read them. YOU too considered it would be fantastic to read them, a single device for only books. Consider this no calumny to the device. But PDFs are seriously not its cup of tea. Mercurial, YOU might be seeing the way the PDF is rendered on the crisp screen. All those toggling and finger gymnastics to get to the line. Dah! I too didn’t seem comfortable.

Next came the fever of converting them to funny formats like .mobi etc that made a nicely indented book look like a unorganised vomit of words.

I tried assiduously to somehow read and lost interest until I stumbled upon a slick python library pyPDF while solving a problem with printing PDFs.

Clip the borders and Light you shall see !

Kindle does automatically clip borders but it retains the primordial page number which limits the usability and since, it also indexes the page number anyway, even if I remove it using some python script it wont hurt.

So, This is what kindify does. Its a command line python utility that simply takes the pdf you intent to read and returns a PDF with the same name but -kindified appended to its file name to be read on the Kindle.

The only dependency is pyPDF .

Install PyPDF using pip :
pip install pypdf

Now clone the github repository:

git clone https://github.com/IndianTinker/kindify.git

Now, paste the PDF in the kindify directory and run the command:

python kindify.py yourPdfName.pdf

An interactive menu will pop up with list of some famous book houses that have predefined cropping parameters. You can always choose the custom one to suit your needs or edit the predefined ones to suit your needs.

Lets see the magic in this sample from Orielly.
Before the script the PDF renders as follows:

Pre Script

And after the script

Post Script

There is a difference between the two images. Clearly the second one is a bit more clear.
So, yet again Python saves the day!

Cheers!

Rohit

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s