CreateLayoutOptions

Page layout, pagination, Form XObjects

Description

Builds a fully populated TPDFlibDynamicLayoutOptions record for ComposeNextLayout with defaults matching plain ComposeNext behaviour

Syntax

Class Function TPDFlibDynamicComponentSession.CreateLayoutOptions(
  ContentWidth, ContentHeight: Double;
  OverflowPolicy: TPDFlibDynamicOverflowPolicy = dopReject;
  HorizontalAlignment: TPDFlibDynamicHorizontalAlignment = dhaLeft;
  VerticalAlignment: TPDFlibDynamicVerticalAlignment = dvaTop;
  PaginationPolicy: TPDFlibDynamicPaginationPolicy = dppAllowSplit;
  MinimumSlotHeight: Double = 0;
  MinimumFollowingHeight: Double = 0):
  TPDFlibDynamicLayoutOptions; Static;

Parameters

ContentWidth, ContentHeightFinite positive natural canvas passed to the component through AvailableWidth and AvailableHeight
OverflowPolicydopReject, dopClip or dopScaleDown
HorizontalAlignmentdhaLeft, dhaCenter or dhaRight
VerticalAlignmentdvaTop, dvaCenter or dvaBottom
PaginationPolicydppAllowSplit, dppKeepTogether or dppRequireComplete
MinimumSlotHeightNon-negative slot height required before component cloning and composition start
MinimumFollowingHeightNon-negative height reserved after a final resolved fragment for a following component

Remarks

The helper assigns every record field from its arguments and performs no validation itself; ComposeNextLayout checks finiteness, positivity and enum ranges before any component work starts

As a static class function it can be called without a session instance

ComposeNext derives its default options from CreateLayoutOptions(Width, Height)

Example

Options := TPDFlibDynamicComponentSession.CreateLayoutOptions(
  640, 360, dopScaleDown, dhaLeft, dvaTop, dppAllowSplit, 72, 24);

Status := Session.ComposeNextLayout(
  PageNumber, 36, 72, 540, 240, Options, Placement);

Return values

TPDFlibDynamicLayoutOptionsRecord populated with the supplied natural canvas, overflow, alignment, pagination and flow-space settings, ready for ComposeNextLayout

See also

ComposeNextLayout, ComposeNext, TPDFlibDynamicComponentSession, KeepTogetherRetryPending, LastRetryReason