PDFium Delphi Component Docs

BuildPdfImpositionPlan function

Unit: PDFium
Computes an N-up or booklet imposition layout as a pure sheet, side and slot plan

Syntax

function BuildPdfImpositionPlan(PageCount: Integer;
  const Options: TPdfImpositionOptions): TPdfImpositionPlan;

Parameters

PageCountInteger
OptionsTPdfImpositionOptions

Return Value

TPdfImpositionPlan

Description

BuildPdfImpositionPlan computes where every source page lands on the output sheets without opening a document, so layouts can be previewed before TPdf.ImportImposed executes them

In pimNUp mode each output side holds a grid of Columns by Rows slots, with 1 to 32 columns or rows and at most 256 slots per side; Duplex doubles the sides per sheet and the page count is padded to whole sides

In pimBooklet mode the plan is a 2-up saddle stitch: the page count is padded to a multiple of 4, the front side of each sheet pairs the last and first logical pages, and the back side carries the inner pair

ReverseSheets flips the logical sheet order, and CreepPerSheet shifts the outer slot columns inwards or outwards by creep times the logical sheet index, which reproduces saddle-stitch shingling

Each slot in Plan.Slots records SheetIndex, SideIndex, SlotIndex, SourcePageIndex, Creep and the Left, Bottom, Width and Height placement inside the output page; a SourcePageIndex of -1 marks a blank filler slot

Plan also reports SourcePageCount, PaddedPageCount, SheetCount, SideCount, SlotsPerSide, and the resolved grid geometry

Remarks

Example

Options := TPdfImpositionOptions.Default;
Options.Mode := pimBooklet;
Plan := BuildPdfImpositionPlan(Pdf.PageCount, Options);

See Also

TPdf.ImportImposed