/ Published in: Bash
URL: http://weblog.bignerdranch.com/?p=23
Here’s how to do it from Linux for A4 paper. If you want to use US letter paper, replace the word a4paper with letterpaper.
I named the script pdf2tinybk, and made it executable using chmod 755 pdf2tinybk. It takes the name of an eight page pdf file for its input and produces a file named book.pdf for its output.
( source: http://weblog.bignerdranch.com/?p=23 )
Expand |
Embed | Plain Text
./pdf2tinybk foo.pdf Enjoy! #!/bin/bash # program to produce folded mini books pdflatex=/usr/bin/pdflatex infile=”$1″ tmpdir=”/tmp/$$” mkdir “$tmpdir” cp “$infile” “$tmpdir/in.pdf” cd “$tmpdir” # invert pages on top half $pdflatex \\batchmode \ ‘\documentclass[a4paper,portrate]{book}\ \usepackage{pdfpages}\ \begin{document}\ \includepdf[pages=1, angle=180]{in.pdf}\ \includepdf[pages=2-5]{in.pdf}\ \includepdf[pages=6-8, angle=180]{in.pdf}\ \end{document}’ mv book.pdf in.pdf # impose pages into mini booklet $pdflatex \\batchmode \ ‘\documentclass[a4paper,landscape]{book}\ \usepackage{pdfpages}\ \begin{document}\ \includepdf[nup=4×2, pages={1,8-6,2-5}, trim=24mm 10mm 24mm 10mm, cut, frame]{in.pdf}\ \end{document}’ mv book.pdf $OLDPWD rm -rf “$tmpdir”
You need to login to post a comment.
