Enum PageMargin

java.lang.Object
java.lang.Enum<PageMargin>
org.apache.poi.ss.usermodel.PageMargin
All Implemented Interfaces:
Serializable, Comparable<PageMargin>, java.lang.constant.Constable

public enum PageMargin extends 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
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

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

    Modifier and Type
    Method
    Description
    static PageMargin
    getByShortValue(short legacyApiValue)
    Retrieves the enumeration value which corresponds to a legacy API constant value
    short
     
    static PageMargin
    Returns the enum constant of this type with the specified name.
    static PageMargin[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

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

    • LEFT

      public static final PageMargin LEFT
      Left margin, the empty space on the left 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
  • Method Details

    • values

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

      public static PageMargin 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.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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