function BuildPdfImpositionPlan(PageCount: Integer;
const Options: TPdfImpositionOptions): TPdfImpositionPlan;
| PageCount | Integer |
| Options | TPdfImpositionOptions |
TPdfImpositionPlanBuildPdfImpositionPlan 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
EPdfError when PageCount is negative or above 1000000, when OutputWidth or OutputHeight is not finite and positive, when Gutter, Bleed or CreepPerSheet is negative or not finite, when the N-up grid exceeds its bounds, or when gutter and bleed leave no slot areaOptions := TPdfImpositionOptions.Default;
Options.Mode := pimBooklet;
Plan := BuildPdfImpositionPlan(Pdf.PageCount, Options);