LayoutContext

LayoutContext

Overview

LayoutContext is a class in Aspose.PDF FOSS for Java.

Tracks the cursor position and content area bounds during page layout.

This class provides 16 methods for working with LayoutContext objects in Java programs. Available methods include: LayoutContext, advanceCursor, getAvailableWidth, getContentBottom, getContentLeft, getContentRight, getContentTop, getCursorX, getCursorY, getPageHeight, getPageWidth, getRemainingHeight, and 4 additional methods. All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package. Properties: availableWidth, contentBottom, contentLeft, contentRight, contentTop, cursorX, and 4 more.

Properties

NameTypeAccessDescription
availableWidthdoubleReadReturns the available width of the content area.
remainingHeightdoubleReadReturns the remaining vertical space from the current cursor position
to the bottom of the content area.
cursorXdoubleReadReturns the current horizontal cursor position.
cursorYdoubleReadReturns the current vertical cursor position.
contentLeftdoubleReadReturns the left edge of the content area.
contentRightdoubleReadReturns the right edge of the content area.
contentTopdoubleReadReturns the top edge of the content area.
contentBottomdoubleReadReturns the bottom edge of the content area.
pageWidthdoubleReadReturns the total page width.
pageHeightdoubleReadReturns the total page height.

Methods

SignatureDescription
LayoutContext(pageWidth: double, pageHeight: double, margins: MarginInfo)Creates a LayoutContext for a page with the given dimensions and margins.
getAvailableWidth()doubleReturns the available width of the content area.
getRemainingHeight()doubleReturns 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)booleanReturns whether there is enough vertical space remaining for content
of the given height.
getCursorX()doubleReturns the current horizontal cursor position.
setCursorX(cursorX: double)Sets the current horizontal cursor position.
getCursorY()doubleReturns the current vertical cursor position.
setCursorY(cursorY: double)Sets the current vertical cursor position.
getContentLeft()doubleReturns the left edge of the content area.
getContentRight()doubleReturns the right edge of the content area.
getContentTop()doubleReturns the top edge of the content area.
getContentBottom()doubleReturns the bottom edge of the content area.
getPageWidth()doubleReturns the total page width.
getPageHeight()doubleReturns the total page height.

See Also

 English