hmemcpy / kindleanpub

Fixes garbled image rendering on (older) Kindle devices of PDFs purchased on Leanpub.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is this?

A small shell script that fixes garbled/broken image rendering on (older) Kindle devices of PDFs purchased on Leanpub, due to some issue with Kindle's method of processing PNG files.

Using Ghostscript, this script will convert all images inside the PDF to JPEG using highest quality conversion.
This will result in smaller output PDF size, and will make the images render properly on older Kindles (e.g. Kindle DX)

Usage

$ pdfix.sh input.pdf

Will produce a file input-fixed.pdf in the same directory.

Ghostscript installation is required! Install on macOS using Homebrew:

brew install ghostscript

Or on Ubuntu / Bash on Windows (WSL) using:

sudo apt-get install ghostscript

(not tested on Windows, but should work!)

Example

Before (11.1MB) After (7.23MB)
before after

About

Fixes garbled image rendering on (older) Kindle devices of PDFs purchased on Leanpub.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Shell 100.0%