How to make a brochure from a pdf file in ubuntu?

Say that I have a 16-page pdf file, A4 sized. I have A4 paper and printer. I want to shrink it to halves, and print them on 4 sheets of paper, double side, fold them in halves, and staple it in the middle.
The way I do it now is to export it to PNG, use LibreOffice Writer to rearrange them. This is time-consuming. Is there a better way to do it? If I have a 64 page file.
PS: What if this is a dictionary and I shall Coptic bind it? https://www.wikihow.com/Coptic-Bind-a-Book How to create folios? My (theoretically,not implemented) solution is to write a Python Script.


TL;DR: the tool for this is called pdfbook

You don't need to write anything. The tool already exists, and does what you want (four-page signatures of 2-up duplex-printed pages) by default. Indeed, if you had a 64-page PDF, by default pdfbook will arrange the pages such that you will use 16 sheets of paper, and print four separate signatures ready for binding precisely as you describe.

pdfbook is provided by texlive-extra-utils:

sudo apt install -y texlive-extra-utils
pdfbook MY-FANCY-MANUSCRIPT.PDF

Outputs a file arranged as you describe called MY-FANCY-MANUSCRIPT-book.PDF suitable for immediate printing however you may like.


There's a handy tool you can download from Ubuntu Software Center to make booklets called PDF Mix Tool.

PDF Mix Tool in Ubuntu Software Center