30

In the past I had a printer that had the booklet format option that would print the document two pages at a time ordered in a way that folding the whole printout would produce a booklet, half the size of the paper which could be stapled in the middle.

My current printer does not support this feature. I would like to use some utility or script to convert an A4 pdf to an A5 booklet one.

I found this page but I'm getting an error : pdfjam ERROR: can't find pdflatex!

How do I get past this issue? Does anybody know of any other solution?

I'm on Ubuntu 12.10 AMD64

  • 3
    If pdflatex can't be found, you should install it... sudo apt-get install texlive-latex-base. The Acrobat Reader has a software booklet option, but your printer should support duplex printing for that. – con-f-use Nov 8 '12 at 11:11
  • 1
    I did that and got another dependency issue. pdfjam ERROR: LaTeX package pdfpages.sty is not installed. It doesn't seem to be a very stable package. I'm resorting to another solution. – To Do Nov 8 '12 at 13:58
  • I installed adobe reader and that solved the problem but it was not so simple on Ubuntu 12.10 64 bit. – To Do Nov 8 '12 at 13:59
  • 4
    Calling apt-file search pdfpages.sty shows that you need to install texlive-latex-recommended, too. – krlmlr Jan 16 '13 at 12:26

12 Answers 12

21

Use pdfbook from texlive-extra-utils

  1. Install texlive-extra-utils:
    sudo apt-get install texlive-extra-utils
  2. Then run pdfbook:
    pdfbook [pdf file]

This will output a pdf file that is in the form of a booklet.

source

  • This worked really well for me, along with using the "long edge" duplex printing option and printing one page per side. (Which, in my specific case, resulted in each A4 printed page holding a total of four A5 pages; two on the front, two on the back.) The only downside is that the resulting booklet was too thick for my stapler, but I can't blame the software tools for that! – a CVn Nov 7 '18 at 20:29
  • 2
    Use pdfbook --short-edge mypdf.pdf for "short-edge" printing instead of the default "long edge". – Gabriel Staples Nov 24 '18 at 23:53
  • Even better for my use case: use pdfnup. Details, example, & install command here: askubuntu.com/a/1095789/327339. – Gabriel Staples Nov 25 '18 at 0:26
12

I found a solution. I installed PDF XChange Viewer for Windows (running through Wine). It has booklet format printing option that works well.

Another option native to Ubuntu is to install Adobe Reader for Linux. It has booklet format printing as well. Install Acrobate on Ubuntu booklet menu for acrobat

EDIT

An even better option that I just found out about is a package called bookletimposer.

  • 1
    Better call it a "workaround"... – krlmlr Jan 16 '13 at 12:26
  • The bookletimposer does strange things for me. It copies some of the images from one page to the page next to it, over the text. – Steven Roose Dec 4 '14 at 9:09
  • 3
    bookletimposer is in Debian and Ubuntu. apt install bookletimposer -> et voila. – odinho - Velmont Sep 4 '15 at 16:45
8

I installed Boomaga from Ubuntu 16.04's repository. It solves all the problems, and dependencies from Acrobat Reader (now unsupported in GNU/Linux). It works with any installed printer.

It works very well and opens quickly with perfect render.

sudo apt install boomaga

What boomaga looks like

  • As per the dependencies for acrobat reader. Follow the instructions for this answer. askubuntu.com/a/512665/485280 . I can confirm that it works after you do the apt command. I had problems with boomaga giving me extra large margins (2.5 inches) on the inside left page... Otherwise, it is a really great program. – Bhikkhu Subhuti Jul 24 '16 at 10:47
  • Took a bit of experimenting with settings to get booklet print correct (n.b., configure printer to "Printer has duplexer", and set all margins to "0" in my case), but then it worked a treat. I followed the Ubuntu installation instructions on Github. (I'm on 16.04 LTS.) – Dɑvïd Jan 12 '17 at 10:35
6

signatures

Using pdfbook is one option which was, however, not quite satisfying since it is only able to create one booklet. In order to create multiple booklets (>> signatures) its "brother" pdfjam does the job:

pdfjam --landscape --signature 40 /path/to/your/document.pdf

Creates a document mirrored along the long edge and creates 40 signatures.

There's also pdfbook2. Unlike pdfjam it shows the --signature option in the manpage. However it seems to be very slow or not working compared to pdfjam

tl;dr

pdfjam seems the best option with a few options (see above). --signature n: n needs to be a multiple of 4.

6

The best solution I found is at http://bernaerts.dyndns.org/linux/74-ubuntu/248-ubuntu-imposition-print-book (linked as "this page" in original question).

Installation command given is

sudo apt-get install poppler-utils pdfjam texlive-extra-utils

which should take care of dependencies.

This is an easy step-by-step guide, including a nifty right-click for Nautilus (which is easily done in Thunar as well).

I still wonder why this function isn't included in CUPS or the general print dialogue.

EDIT oct '19: As of now I recommend the answer above, https://askubuntu.com/a/763721/142472 - install Boomaga

3

I found this python-gtk script, pdfbooklet that takes a PDF, rearranges the pages to make a booklet, and saves that as a PDF. It has a number of options to automatically generate different types of booklets.

It depends on python-poppler.

2

It should have nothing to do with your printer as long as the printer has duplex(both sides of a page) printing. It has to do with page ordering.

It is incredible that such a simple function does not exist yet in Ubuntu.

I solved for my 4 pages booklet, putting the number of the pages to be printed in this order: 4,1,2,3. For a 8 pages booklet it would be 8,1,2,7,6,3,4,5. For a 16pages one... 16,1,2,15,14,3,4,13,12,5,6,11,10,5... and so on .... Not practical and immediate but Works.

  • 1
    The booklet function was a feature of my previous printer's driver. The driver of the printer I have now doesn't have that feature. – To Do Jan 4 '13 at 17:26
  • Exists, too: psbook or pdfbook do this for you. See this related post: askubuntu.com/q/52269/30266 – krlmlr Jan 16 '13 at 12:30
  • The order specified in the print dialog seems to be ignored on 14.04.3 LTS. The pages are printed in the numeric order, no matter in what order you specify them. Tested with a Samsung CLX-3175N printer. – Peterino Oct 14 '15 at 8:39
  • 1
    16pp = 16,1,2,15,14,3,4,13,12,5,6,11,10,7,8,9 ;) – Dɑvïd Sep 26 '17 at 14:55
1

I’ve written a zsh script that prints a A4 PDF as booklet (on A3 Paper):

#!/bin/zsh

zmodload zsh/mathfunc

f="$1"; shift

if [[ ! -f "$f" ]]; then
    echo "Not a file: “$f”" >&2
    exit 1
fi

total_pages="$(pdfinfo "$f" | grep '^Pages:' | grep -Po '\d+$')"

pages="${2-$total_pages}"

sig="$(( int(ceil(pages / 4.) * 4) ))"

pdf="$(mktemp --suffix=.pdf)"

pdfbook --a3paper --signature "$sig" -o "$pdf" "$f" "1-$pages"

#two-sided-long-edge apparently only means *long edge* when in portrait mode
lpr \
    -o media=A3 \
    -o sides=two-sided-long-edge \
    -o landscape=true \
    "$pdf"

unlink "$pdf"

note that your printer config might be less broken than mine and you actually need to use -o sides=two-sided-short-edge

1

I had the same question. I like you, ran into those problems while trying to use pdfjam (apart from the large size of the packages that it needed installed). I asked a question on superuser, and the solution was perfect.

https://superuser.com/questions/596035/condensing-into-multiple-pdf-pages-per-sheet-via-command-line

I will recreate it here below, but please credit/upvote the original responder:

to perform an IMPOSITION, nothing is better than Multivalent.jar (latest free version with tools inside, latest Multivalent build currently hosted on sourceforge - 2009 - has no more pdf tools)

you can download the Multivalent.jar build with tools from:

http://www.ziddu.com/download/1794145/Multivalent.tar.gz.html
http://ge.tt/#!/21OPDHX/v/4
http://dingodog.minus.com/mjhNX8Eiu
online man - http://multivalent.sourceforge.net/Tools/pdf/Impose.html

use:

java -cp path...to/Multivalent.jar tool.pdf.Impose -dim (rowsxcols) -paper (paper sizes where pages will be imposed) file.pdf
0

Qoppa's free PDF Reader called PDF Studio Viewer has a booklet printing option under the Print dialog and runs on Linux. PS: I am a developer. https://www.qoppa.com/pdfstudioviewer/

0

I'm currently using Gnome Manual Duplex. It works out of the box for a number of printers and can be used with others with manual configuration. https://sourceforge.net/projects/g-manual-duplex/files/

0

For some cases you may want to use pdfnup instead. It allows you to pack multiple sheets on 1.

Install pdfnup on Ubuntu with sudo apt install texlive-extra-utils.

Examples:

Sample usage: pdfnup --nup 2x1 mypdf.pdf. This creates a pdf with 2 pages side-by-side per sheet on a landscape view, to be printed flipped over the short edge. See man pdfnup for a few more details.

You can do multiple pdfs as a batch with pdfnup --nup 2x2 --suffix '2x2' --batch myfile1.pdf myfile2.pdf, for example. The --sufix part simply says what to add as a suffix to the output file name. (This last example taken from the man page).

Sources:

Related:

  • For anyone wanting to take 1 x 1-pg pdf and turn it into a pdf with 2 copies of that 1 pg side-by-side in landscape view (great for printing flyers), do: https://superuser.com/a/1452008/425838

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.