PDFium Delphi Component Docs

ImportImposed method

Component: TPdf  ·  Unit: PDFium
Create a new N-up or booklet document through batched native composition and return deterministic execution facts

Syntax

function ImportImposed(const Options: TPdfImpositionOptions; out Plan: TPdfImpositionPlan): TPdf;

function ImportImposed(const Options: TPdfImpositionOptions; out Plan: TPdfImpositionPlan; out Report: TPdfImpositionExecutionReport): TPdf;

OptionsTPdfImpositionOptions. Fields Mode, OutputWidth, OutputHeight, Columns, Rows, Duplex, ReverseSheets, Gutter, Bleed and CreepPerSheet, with a Default class function
PlanTPdfImpositionPlan. Fields SourcePageCount, PaddedPageCount, SheetCount, SideCount, SlotsPerSide, Slots, OutputWidth, OutputHeight, Columns, Rows, Gutter and Bleed; each TPdfImpositionSlot carries SheetIndex, SideIndex, SlotIndex, SourcePageIndex, Creep, Left, Bottom, Width and Height
ReportTPdfImpositionExecutionReport. Fields NativeImportCallCount, NativeImportedPageCount, UniqueSourcePageCount, BlankSlotCount, XObjectTemplateCount, FormObjectCount, ContentGenerationCallCount, OutputPageCount and UsedNativeNUp
ResultTPdf. A new active document owned by the caller, or nil when native composition fails

Description

BuildPdfImpositionPlan validates all limits, preallocates the exact slot count and determines every source and blank slot before document creation begins

Booklet mode pads to a multiple of four and creates front and back side order; N-up duplex mode pads incomplete physical sheets so reversing sheets never loses or reassigns source pages

Each slot records its usable Left, Bottom, Width and Height after outer bleed, inter-cell gutter and signed creep are applied

Zero-geometry jobs import all ordered non-blank pages through one FPDF_ImportPagesByIndex call, insert planned blanks and use FPDF_ImportNPagesToOne as the fast path

Jobs with gutter, bleed or creep cache one native page XObject per unique source page and create independent form objects with exact placement matrices

Both paths preserve the source document current page; the report overload exposes the execution counts needed for diagnostics and performance regression tests

The caller must free the returned document

See Also

ImportNPagesToOne, ImportPagesByIndex, CompareWith