Snippets

Dénes Türei Create printable booklet from a scanned book pdf

Updated by Dénes Türei

File pdf_booklet.sh Modified

  • Ignore whitespace
  • Hide word diff
 # each A4 page we print two consecutive odd pages (e.g. 1 and 3), while on
 # the other side the two corresponding even pages (4 and 2). Then we send
 # the document to the printer with 2 pages per page and two sided printing
-# (collate short side) settings. The printed A4 pages can be cut precisely
+# (flip on short edge) settings. The printed A4 pages can be cut precisely
 # in the middle into A5 size with a paper cutting tool. Finally, we bind
 # the A5 pages together to form a booklet.
 #
Created by Dénes Türei

File pdf_booklet.sh Added

  • Ignore whitespace
  • Hide word diff
+#!/usr/bin/bash
+
+# Create printable booklet from a scanned book pdf
+#
+# Here we want to print an A5 size booklet in a way that on the top side of
+# each A4 page we print two consecutive odd pages (e.g. 1 and 3), while on
+# the other side the two corresponding even pages (4 and 2). Then we send
+# the document to the printer with 2 pages per page and two sided printing
+# (collate short side) settings. The printed A4 pages can be cut precisely
+# in the middle into A5 size with a paper cutting tool. Finally, we bind
+# the A5 pages together to form a booklet.
+#
+# To create a pdf with a page order suitable for this kind of printing, we
+# use pdftk (PDF Toolkit), a simple and efficient command line tool for pdf
+# manipulation. The tool is available from the web page below or from most
+# of the Linux package repositories.
+#
+# https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
+#
+# Once we have pdftk installed, it takes only two commands to reorder the
+# pages. First we sort the even and odd pages into separate files. Then we
+# merge these files in a way that we take 2 pages from the odd pages, and
+# 2 from the even but in reversed order.
+
+pdftk original.pdf cat 1-endeven output even.pdf
+pdftk original.pdf cat 1-endodd output odd.pdf
+pdftk A=odd.pdf B=even.pdf shuffle Aodd Aeven Beven Bodd output booklet.pdf
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.