Package javafx.print

Enum Printer.MarginType

    • Enum Constant Detail

      • DEFAULT

        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 Detail

      • values

        public static Printer.MarginType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Printer.MarginType c : Printer.MarginType.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Printer.MarginType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null