Imposition¶
setImposition(settings)¶
Applies imposition settings. The object is a partial overlay — keys you omit keep their
current value. Returns true; an unknown enum value throws. Lengths are in the current unit
(or a suffixed string like "6mm"); legacy …Mm/…Pt keys are always millimetres/points.
doc.setImposition({
sheet: { preset: "SRA3", portrait: true },
layout: { type: "Booklet", cols: 2, rows: 2, order: "Z" },
cropMarks: { enabled: true },
});
sheet¶
| Key | Type | Values / notes |
|---|---|---|
preset |
string | Paper preset (sets size); see list below |
portrait |
bool | Orientation |
width / height |
number|string | Explicit size (overrides preset). Legacy: widthMm, heightMm |
preset values: Auto, Custom, A0–A4, B0–B3, SRA0–SRA4, Letter,
Legal, Tabloid, SuperB, ArchB, 19x25, 23x35, 25x38, 28x40 (case-insensitive;
US-prefixed aliases also accepted).
layout¶
| Key | Type | Values / notes |
|---|---|---|
type |
string | Imposition type (see below) |
autoMode |
string | FitGridToSheet, FitSheetToGrid, Manual |
cols, rows |
int | Grid |
order |
string | Z, N, ZReverse, NReverse |
scale |
string | Fit, Fill, None (100%) |
placedRotation |
string | Auto, 0, 90, 180, 270 |
gutterH, gutterV |
length | Gutters between cells (legacy gutterHMm/gutterVMm) |
spine |
length | Booklet binding gutter between facing pairs (legacy spineMm) |
gutterAuto |
bool | Auto-compute gutters |
marginTop, marginBottom, marginLeft, marginRight |
length | Sheet margins |
type values: NUp, Booklet, Section, Sequential, StepRepeat, CutAndStack,
FlipCalendar, TriFold, WallCalendar, Accordion, HalfFold, GreetingCard.
source¶
| Key | Type | Values |
|---|---|---|
mode |
string | all, selected, range |
range |
string | Page range when mode:"range" (e.g. "1-8") |
cropMarks¶
| Key | Type | Values / notes |
|---|---|---|
enabled |
bool | |
length |
length | Mark length (legacy lengthMm) |
offset |
length | Distance from trim (legacy offsetMm) |
weight |
number (pt) | Line weight (legacy weightPt) |
sides |
string | both, front, back, first (firstpage), last (lastpage) |
centerMarks |
bool | |
registrationMarks |
bool |
booklet¶
Saddle-stitch / section binding.
| Key | Type | Values / notes |
|---|---|---|
foldScheme |
string | 4pp, 8pp, 16pp, 16ppWide (or 4/8/16/wide) |
bindingEdge |
string | left, right |
duplexFlip |
string | short (left), long (top) |
creep |
bool | Creep/shingling compensation |
paperCaliper |
length | Sheet thickness for creep (legacy paperCaliperMm) |
sheetsPerSig |
int | Sheets nested per signature (perfect binding) |
stepRepeat¶
Gang-up of multiple designs.
| Key | Type | Values |
|---|---|---|
sides |
string | simplex, duplex |
perDesign |
string | ownSheet, equal, count |
count |
int | Copies per design (with count) |
fill |
string | cycle, blank |
backFlip |
string | left, top (duplex back-side flip edge) |
For sides: "duplex", the planner pairs source pages into front/back designs and produces
front and back sheets, mirroring positions for the physical flip per backFlip.
sequential / cutStack¶
Two-sided pieces for the Sequential and Cut & Stack types. Pages pair up front/back (page 1 = front, page 2 = its back, …); output sheets alternate front and back, and an odd page count leaves the last back blank.
| Key | Type | Values |
|---|---|---|
sides |
string | simplex, duplex |
backFlip |
string | left, top (back-side flip edge) |
Duplex output (Booklet, Section, Half-fold, Tri-fold, two-sided Step & Repeat, Flip
calendar, …) also carries a duplex print hint in the PDF (/ViewerPreferences /Duplex),
so print dialogs pre-select two-sided printing with the correct flip edge.
output¶
| Key | Type | Values / notes |
|---|---|---|
profile |
string | pdf (standard), rasterized (flatten), gs (Ghostscript) |
gsPreset |
string | prepress, printer, ebook, screen, pdfx1a, custom |
gsArgs |
string | Extra Ghostscript args (custom preset) |
dpi |
int | Raster DPI |
cmyk |
bool | Rasterise to CMYK (also toCmyk) |
intent |
string|int | perceptual, relative, saturation, absolute (or 0–3) |
iccProfile |
path | CMYK ICC profile (empty = bundled GRACoL); alias cmykProfile |
rasterizer |
string | inhouse (default) / gs |
gsRasterize |
bool | Flatten transparency before Ghostscript |
targetVersion¶
Output PDF version ambition: "1.3"–"1.7", or "latest" (default 1.4).
generateImposition() → Document¶
Produces the imposed PDF from the current settings and returns it as a new Document
(null + throws on error).
var out = doc.generateImposition();
out.save("/path/booklet_imposed.pdf", { autoIndex: true });
See a complete, recorded settings object in Examples.