Package javafx.print

Enum Class Printer.MarginType

All Implemented Interfaces:
Serializable, Comparable<Printer.MarginType>, Constable
Enclosing class:

public static enum Printer.MarginType extends Enum<Printer.MarginType>
The MarginType is used to determine the printable area of a PageLayout.
JavaFX 8.0
  • Enum Constant Details


      public static final Printer.MarginType DEFAULT
      This requests a default 0.75 inch margin on all sides. This is considered to be a common default and is supported by all known printers. However this may be adjusted if the paper is too small, to ensure that the margins are not more than 50% of the smaller dimension. Applications that do expect to deal with such small media should likely be specifying the required margins explicitly. In the unlikely event the hardware margin is larger than 0.75" it will be adjusted to that same hardware minimum on all sides.

      public static final Printer.MarginType HARDWARE_MINIMUM
      Request margins are set to be the smallest on each side that the hardware allows. This creates the greatest printable area but the margins may not be aesthetic if they are too small, or there is significant variation on the different sides of the paper.

      This is is also useful for an application that wants to know this so it can construct a new PageLayout that fits within these margins.

    • EQUAL

      public static final Printer.MarginType EQUAL
      Choose the largest of the four hardware margins, and use that for all for margins, so that the margins are equal on all sides.

      public static final Printer.MarginType EQUAL_OPPOSITES
      Similar to EQUAL, but it chooses the larger of the left/right hardware margins and top/bottom hardware margins separately, so that the top and bottom margins are equal, and the left and right margins are equal.
  • Method Details

    • values

      public static Printer.MarginType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Printer.MarginType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null