booklet
Make a PDF booklet
Impose a PDF for saddle-stitch printing, so it folds into a booklet.
- Reads
- a PDF — application/pdf
- Writes
- one file — PDFs
- Tool page
- /pdf-booklet
Example
Impose eight pages so that folding the printed stack gives a booklet.
Given
- zine.pdf — an ordinary PDF of 8 pages
From code
import { loadDocument, runOperation } from '@pagecraft/core';
const zine = await loadDocument({ bytes, name: 'zine.pdf' });
const [output] = await runOperation('booklet', [zine]);
From a shell
pagecraft booklet zine.pdf
What comes back
One PDF of 4 pages.
This example is run by the test suite. If it stopped being true, the build would fail.
Options
size--size
string, one of
Sheet size
The paper you print on. Two pages go side by side on each side of it.
Default: 'a4'
a3— A3a4— A4a5— A5a6— A6b5— B5letter— Letterlegal— Legaltabloid— Tabloidexecutive— Executive
margin--margin
number
Margin
Default: 0
unit--unit
string, one of
Measured in
Default: 'mm'
mm— Millimetrescm— Centimetresin— Inchespt— Points
pages--pages
string, a page selection: '1-3, 7, 9-', 'even', 'last'
Pages
Which pages go into the booklet, and in what order.
Default: 'all'
What it cannot do
- The sheets come out in printing order. Feed them through as one stack, then fold and staple.
- A bookmark follows its page to the sheet it landed on. Links and form fields do not: two pages now share a sheet, and there is nowhere correct to put them.
- The booklet reads left to right.