LayoutContext
Overview
LayoutContext is a class in Aspose.Pdf FOSS for Java.
Tracks the cursor position and content area bounds during page layout.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
availableWidth | double | Read | Returns the available width of the content area. |
remainingHeight | double | Read | Returns the remaining vertical space from the current cursor position |
| to the bottom of the content area. | |||
cursorX | double | Read | Returns the current horizontal cursor position. |
cursorY | double | Read | Returns the current vertical cursor position. |
contentLeft | double | Read | Returns the left edge of the content area. |
contentRight | double | Read | Returns the right edge of the content area. |
contentTop | double | Read | Returns the top edge of the content area. |
contentBottom | double | Read | Returns the bottom edge of the content area. |
pageWidth | double | Read | Returns the total page width. |
pageHeight | double | Read | Returns the total page height. |
Methods
| Signature | Description |
|---|---|
LayoutContext(pageWidth: double, pageHeight: double, margins: MarginInfo) | Creates a LayoutContext for a page with the given dimensions and margins. |
getAvailableWidth() → double | Returns the available width of the content area. |
getRemainingHeight() → double | Returns the remaining vertical space from the current cursor position |
| to the bottom of the content area. | |
advanceCursor(height: double) | Moves the cursor down by the specified height. |
resetCursorX() | Resets the horizontal cursor to the left edge of the content area. |
hasSpace(height: double) → boolean | Returns whether there is enough vertical space remaining for content |
| of the given height. | |
getCursorX() → double | Returns the current horizontal cursor position. |
setCursorX(cursorX: double) | Sets the current horizontal cursor position. |
getCursorY() → double | Returns the current vertical cursor position. |
setCursorY(cursorY: double) | Sets the current vertical cursor position. |
getContentLeft() → double | Returns the left edge of the content area. |
getContentRight() → double | Returns the right edge of the content area. |
getContentTop() → double | Returns the top edge of the content area. |
getContentBottom() → double | Returns the bottom edge of the content area. |
getPageWidth() → double | Returns the total page width. |
getPageHeight() → double | Returns the total page height. |