ComposeNext

Page layout, pagination, Form XObjects

Description

Composes one stateful dynamic fragment into a destination page slot using the default layout policy and reports the final placement

Syntax

Function TPDFlibDynamicComponentSession.ComposeNext(Page: Integer;
  Left, Top, Width, Height: Double;
  Out Placement: TPDFlibDynamicPagePlacement): Integer;

Parameters

PageExisting one-based destination page number
Left, TopTop-left destination position in current document units
Width, HeightFinite positive destination slot size that also becomes the natural canvas size
PlacementEmitted placement record describing the committed fragment

Remarks

The call builds its options through CreateLayoutOptions(Width, Height) and forwards to ComposeNextLayout, so it inherits dopReject overflow handling, dhaLeft and dvaTop alignment, dppAllowSplit pagination and no flow-space minimums

The used rectangle must fit the slot, because the default overflow policy rejects rather than clips or scales

ComposeNextLayout for the full placement, retry and transform behaviour

Example

repeat
  Status := Session.ComposeNext(PageNumber, 36, 36, 540, 720,
    Placement);
  if Status = PDF_DYNAMIC_COMPONENT_MORE then
    PageNumber := PDF.NewPage;
until Status <> PDF_DYNAMIC_COMPONENT_MORE;

Return values

PDF_DYNAMIC_COMPONENT_ERRORInput, callback, geometry, overflow or placement validation failed without committing state
PDF_DYNAMIC_COMPONENT_MOREThe fragment was committed and more content remains
PDF_DYNAMIC_COMPONENT_COMPLETEThe fragment completed the session or the session was already complete
PDF_DYNAMIC_COMPONENT_RETRYPagination or flow-space policy deferred the uncommitted trial to another slot

See also

ComposeNextLayout, CreateLayoutOptions, TPDFlibDynamicComponentSession, Compose, Completed, CompositionCount