Compose
Page layout, pagination, Form XObjects
Description
Abstract method of TPDFlibDynamicComponent that draws one fragment of the component in local coordinates and reports its used bounds and continuation state
Syntax
Function TPDFlibDynamicComponent.Compose(
Const Context: TPDFlibDynamicPageContext;
Out ComposeResult: TPDFlibDynamicPageResult): Integer;
Virtual; Abstract;
Parameters
Context.LibraryInstance | Attached TPDFlib instance the fragment shall draw through |
|---|---|
Context.PageNumber | Destination page number even though the library selects an isolated temporary page while the callback runs |
Context.CompositionIndex | One-based number the fragment receives when it commits |
Context.DestinationLeft, Context.DestinationTop | Destination slot position passed through from the compose call |
Context.AvailableWidth, Context.AvailableHeight | Natural canvas size of the surrounding Form XObject |
Result record
HasContent | True when the fragment drew visible content |
|---|---|
HasMoreContent | True when the component can produce another fragment |
UsedWidth, UsedHeight | Used rectangle that starts at local coordinate zero and shall bound all visible component content |
Remarks
Content results require finite positive UsedWidth and UsedHeight values within AvailableWidth and AvailableHeight
A no-content result is valid only when HasMoreContent is False and both used dimensions are zero
The callback may use drawing and content APIs but shall not change documents, pages or nested drawing containers
The session validates ComposeResult through ValidComposeResult before any placement decision is made
Returning zero rejects the attempt without committing component or destination state; raised exceptions propagate after the session has cleaned up temporary state
Return values
1 | The fragment result is offered for validation and placement |
|---|---|
0 | The attempt is rejected and no component or destination state changes |
See also
TPDFlibDynamicComponent, TPDFlibDynamicPageContext, TPDFlibDynamicPageResult, ValidComposeResult, ComposeNextLayout, CloneComponent