org.apache.fop.render.pcl

## Class PCLPageDefinition

- java.lang.Object
- - org.apache.fop.render.pcl.PCLPageDefinition

-     public class PCLPageDefinition
      extends Object

  This class represents a page format with PCL-specific properties.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PCLPageDefinition(String name, int selector, Dimension physicalPageSize, Rectangle logicalPageRect, boolean landscape)` Main constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static PCLPageDefinition` | `getDefaultPageDefinition()`
    `Rectangle` | `getLogicalPageRect()`
    `String` | `getName()`
    `static PCLPageDefinition` | `getPageDefinition(long width, long height, int errorMargin)` Tries to determine a matching page definition.
    `static PCLPageDefinition` | `getPageDefinition(String name)` Returns a page definition based on a page format.
    `Dimension` | `getPhysicalPageSize()`
    `int` | `getSelector()`
    `boolean` | `isLandscapeFormat()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PCLPageDefinition

          public PCLPageDefinition(String name,
                                   int selector,
                                   Dimension physicalPageSize,
                                   Rectangle logicalPageRect,
                                   boolean landscape)

      Main constructor
      Parameters:
        `name` - the name of the page definition
        `selector` - the selector used by the <ESC> command (page size)
        `physicalPageSize` - the physical page size
        `logicalPageRect` - the rectangle defining the logical page
        `landscape` - true if it is a landscape format

  - ### Method Detail

    - #### getName

          public String getName()

      Returns:
        the name of the page definition

    - #### getSelector

          public int getSelector()

      Returns:
        the selector used by the <ESC> command (page size)

    - #### isLandscapeFormat

          public boolean isLandscapeFormat()

      Returns:
        true if it is a landscape format

    - #### getPhysicalPageSize

          public Dimension getPhysicalPageSize()

      Returns:
        the physical page size

    - #### getLogicalPageRect

          public Rectangle getLogicalPageRect()

      Returns:
        the rectangle defining the logical page

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getPageDefinition

          public static PCLPageDefinition getPageDefinition(long width,
                                                            long height,
                                                            int errorMargin)

      Tries to determine a matching page definition.
      Parameters:
        `width` - the physical page width (in mpt)
        `height` - the physical page height (in mpt)
        `errorMargin` - the error margin for detecting the right page definition
      Returns:
        the page definition or null if no match was found

    - #### getPageDefinition

          public static PCLPageDefinition getPageDefinition(String name)

      Returns a page definition based on a page format.
      Parameters:
        `name` - the name of the page format (ex. "A4" or "Letter")
      Returns:
        the page definition or null if no match was found

    - #### getDefaultPageDefinition

          public static PCLPageDefinition getDefaultPageDefinition()

      Returns:
        the default page definition (letter)

Copyright © 2023 Apache Software Foundation. All rights reserved.