58

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

4
  • 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, 2012 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, 2012 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, 2012 at 13:59
  • 5
    Calling apt-file search pdfpages.sty shows that you need to install texlive-latex-recommended, too.
    – krlmlr
    Jan 16, 2013 at 12:26

12 Answers 12

44

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

7
  • 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!
    – user
    Nov 7, 2018 at 20:29
  • 7
    Use pdfbook --short-edge mypdf.pdf for "short-edge" printing instead of the default "long edge". Nov 24, 2018 at 23:53
  • 1
    Even better for my use case: use pdfnup. Details, example, & install command here: askubuntu.com/a/1095789/327339. Nov 25, 2018 at 0:26
  • 3
    The command seems to be pdfbook2 as of 22.04+, everything else remains the same. Mar 20, 2023 at 17:04
  • 1
    @neopostmodern Yes, that's very important. It should be added in an edit to the answer
    – Wilson
    Jun 24, 2023 at 17:21
21

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

2
  • 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. Jul 24, 2016 at 10:47
  • 1
    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, 2017 at 10:35
20

tl;dr

pdfjam seems the best option:

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

What we want is one or more signatures/booklets (a bunch of sheets folded in half).

signatures

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 its "brother" pdfjam helps us out here:

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

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

Note: For --signature n: n must be a multiple of 4


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

5
  • Is it possible to make the binding over the short edge? Oct 8, 2020 at 3:48
  • 1
    pdfbook is part of pdfjam so a short-edge option should exist. See also here: github.com/DavidFirth/pdfjam Oct 8, 2020 at 10:14
  • 1
    Didn't find any. I ended up using bookletimposer. Oct 12, 2020 at 14:43
  • Note: pdfbook2 has not been updated since 2020. → GitHub Mar 7, 2023 at 13:12
  • there is pdfjam --longedge and pdfjam --shortedge
    – milahu
    Aug 17, 2023 at 9:36
17

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 Acrobat Reader on Ubuntu booklet menu for acrobat

EDIT

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

5
  • 3
    Better call it a "workaround"...
    – krlmlr
    Jan 16, 2013 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. Dec 4, 2014 at 9:09
  • 6
    bookletimposer is in Debian and Ubuntu. apt install bookletimposer -> et voila. Sep 4, 2015 at 16:45
  • 2
    +1 for bookletimposer Oct 8, 2020 at 4:07
  • +1 for bookletimposer
    – netbat
    Mar 28, 2022 at 13:18
7

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

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.

4
  • 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, 2013 at 17:26
  • Exists, too: psbook or pdfbook do this for you. See this related post: askubuntu.com/q/52269/30266
    – krlmlr
    Jan 16, 2013 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, 2015 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, 2017 at 14:55
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.

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

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/

1
  • Your software is beautiful. I wish that this had been a solution for me but it did not print double sided on my brother printer. I ended up going with the windows pdfxchange viewer which worked. I tried printing to a file with your software but the file got cut off on the edges. Otherwise whenever it becomes stable it will be an awesome solution for Linux users. Thank you . Aug 17, 2021 at 15:15
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
1

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:

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:

pdfnup --nup 2x1 mypdf.pdf

You can do multiple pdfs as a batch like this (this example is taken from the man page: man pdfnup):

pdfnup --nup 2x2 --suffix '2x2' --batch myfile1.pdf myfile2.pdf

The --sufix '2x2' part simply says to add 2x2 as a suffix to the output file name, for easier recognition of which files it just generated.

References:

  1. Super User: one answer to "How to convert a 1 page PDF to a 2 page per sheet PDF?" (and see comments underneath)
  2. Super User: another answer to "How to convert a 1 page PDF to a 2 page per sheet PDF?" (and see comments underneath)
  3. man pdfnup

Related:

  1. For anyone wanting to take a 1 or 2 pg pdf and turn it into a pdf with 2 copies of that side-by-side in landscape view (great for printing flyers), see my answer here.
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/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .