Enum PageMargin

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PageMargin>

    public enum PageMargin
    extends java.lang.Enum<PageMargin>
    Enumeration which represents the various margins which are present within an Excel worksheet

    Page margins are relevant when printing worksheets, and define the amount of empty space on the edges of each printed page

    Since:
    POI 5.2.3
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOTTOM
      Bottom margin, the empty space on the bottom of displayed worksheet data when printing
      FOOTER
      Footer margin, the empty space between the footer and the bottom of the page when printing
      HEADER
      Header margin, the empty space between the header and the top of the page when printing
      LEFT
      Left margin, the empty space on the left of displayed worksheet data when printing
      RIGHT
      Right margin, the empty space on the right of displayed worksheet data when printing
      TOP
      Top margin, the empty space on the top of displayed worksheet data when printing
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static PageMargin getByShortValue​(short legacyApiValue)
      Retrieves the enumeration value which corresponds to a legacy API constant value
      short getLegacyApiValue()  
      static PageMargin valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PageMargin[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LEFT

        public static final PageMargin LEFT
        Left margin, the empty space on the left of displayed worksheet data when printing
      • RIGHT

        public static final PageMargin RIGHT
        Right margin, the empty space on the right of displayed worksheet data when printing
      • TOP

        public static final PageMargin TOP
        Top margin, the empty space on the top of displayed worksheet data when printing
      • BOTTOM

        public static final PageMargin BOTTOM
        Bottom margin, the empty space on the bottom of displayed worksheet data when printing
      • HEADER

        public static final PageMargin HEADER
        Header margin, the empty space between the header and the top of the page when printing
      • FOOTER

        public static final PageMargin FOOTER
        Footer margin, the empty space between the footer and the bottom of the page when printing
    • Method Detail

      • values

        public static PageMargin[] 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 (PageMargin c : PageMargin.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PageMargin valueOf​(java.lang.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.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getLegacyApiValue

        public short getLegacyApiValue()
      • getByShortValue

        public static PageMargin getByShortValue​(short legacyApiValue)
        Retrieves the enumeration value which corresponds to a legacy API constant value
        Parameters:
        legacyApiValue - An old API margin constant value
        Returns:
        The PageMargin enumeration which corresponds to the given value, or null if no corresponding value exists