ImposePagesNUp

Page manipulation

Description

Lays the document's pages out onto Columns x Rows sheets of the requested size, replacing the page tree with the imposed sheets, and returns the number of sheets created. Returns 0 when the document has fewer than two pages or a parameter is invalid.

Syntax

Delphi

Function TPDFlib.ImposePagesNUp(Columns, Rows: Integer; TargetWidth, TargetHeight: Double; Options: Integer): Integer;

Parameters

Columns and Rows set the grid (2 and 2 for four-up). TargetWidth/TargetHeight are the size of the imposed sheets in page units. Options 0 lays the pages out in reading order; 1 produces saddle-stitch booklet sheets (the grid is forced to 2 x 1, the page count is padded to a multiple of four, and sheets pair the outermost with the innermost pages so the printed stack folds into a booklet).

Return Values

Returns the number of imposed sheets created, or 0 when the document has fewer than two pages or a parameter is invalid.

Remarks

Every source page is captured as a form XObject and redrawn aspect-fit and centred inside its grid cell, so vector content stays vector. The source pages are removed from the page tree; after the call the document contains only the imposed sheets.