Enum Class PaperSize

java.lang.Object
java.lang.Enum<PaperSize>
megameklab.printing.PaperSize
All Implemented Interfaces:
Serializable, Comparable<PaperSize>, Constable

public enum PaperSize extends Enum<PaperSize>
A collection of constants used for setting up print jobs
  • Enum Constant Details

    • US_LETTER

      public static final PaperSize US_LETTER
    • ISO_A4

      public static final PaperSize ISO_A4
  • Field Details

    • sizeName

      public final MediaSizeName sizeName
    • printableArea

      public final MediaPrintableArea printableArea
    • pxWidth

      public final int pxWidth
    • pxHeight

      public final int pxHeight
    • displayName

      public final String displayName
    • dirName

      public final String dirName
  • Method Details

    • values

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

      public static PaperSize 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.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • closestToAspect

      public static PaperSize closestToAspect(double width, double height)
    • createPaper

      public Paper createPaper()
      Creates a Paper instance with 1/4" margins
      Returns:
      A Paper for use with a PageFormat
    • createPaper

      public Paper createPaper(int left, int top, int right, int bottom)
      Creates a Paper instance with the provided margins. Units are in 1/72 inches.
      Parameters:
      left - The left margin
      top - The top margin
      right - The right margin
      bottom - The bottom margin
      Returns:
      A Paper for use with a PageFormat