PDF Cropper is a command line tool to generate cropped PDF for ebook readers.
Install prawn and clone git repository.
$ gem install prawn $ git clone git://github.com/okkez/pdf-cropper.git
Copy your PDF files to current directory like below.
$ ls Rakefile hoge.pdf fuga.pdf
Execute command below.
$ rake
Edit Rakefile. Specify crop size as percentage.
:skip
means that skip given pages. Page number is one origin.
OPTIONS = {
:left => 13.0,
:right => 13.0,
:top => 10.0,
:bottom => 5.0,
:skip => [1],
}
The default settings are optimized for O’Reilly Japan’s ebook.
$ rake -T rake clean # Remove any temporary products. rake clobber # Remove any generated file. rake crop # Crop pdf file in current directory. rake crop_force # Force crop pdf file in current directory.