Package javafx.print

Class PageLayout

java.lang.Object
javafx.print.PageLayout

public final class PageLayout extends Object
A PageLayout encapsulates the information needed to lay out content. The reported width and height can be considered equivalent to the clip enforced by a Window. Applications that obtain a PageLayout instance will need to inspect the width and height to perform layout and pagination. Other information such as orientation and the Paper being used and margins outside of this area are not needed for page rendering.

Printers usually have hardware margins where they cannot print. A PageLayout instance obtained from a PrinterJob in the context of a specific printer will be correctly set up to print over the whole of that area. If an application adjusts the printable area outside of this bounds, rendering to those areas will be clipped by the device.

Within those hardware margins, the application may define any printable area it needs. The resulting printable area will define the effective dimensions of the page available to the application at printing time.

Applying a PageLayout configured based on one printer, to a job on a different printer may not work correctly, as the second printer may not support the same margins, and may not even support the same Paper. In such a case, the PageLayout must be validated against the new printer.

A PageLayout is immutable.

Since:
JavaFX 8.0