/pdf-cropper

Generate cropped PDF files for ebook readers.

Primary LanguageRuby

PDF Cropper

PDF Cropper is a command line tool to generate cropped PDF for ebook readers.

How to install

Install prawn and clone git repository.

$ gem install prawn
$ git clone git://github.com/okkez/pdf-cropper.git

How to use

Copy your PDF files to current directory like below.

$ ls
Rakefile  hoge.pdf fuga.pdf

Execute command below.

$ rake

How to customize

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.

Task list

$ 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.