Class PageSize


  • public class PageSize
    extends java.lang.Object

    Class that represents a page with a specified origin and size. The class is immutable and can be initialized with coordinates and dimensions or only dimensions:

    PageSize a3 = new PageSize(0.0, 0.0, 297.0, 420.0);
    PageSize a4 = new PageSize(210.0, 297.0);

    For convenience the class contains static constants for common page sizes:

    PageSize a4 = PageSize.A4;
    PageSize letter = PageSize.LETTER;
    • Field Detail

      • LETTER

        public static final PageSize LETTER
      • LEGAL

        public static final PageSize LEGAL
      • TABLOID

        public static final PageSize TABLOID
      • LEDGER

        public static final PageSize LEDGER
      • x

        private final double x
      • y

        private final double y
      • width

        private final double width
      • height

        private final double height
    • Constructor Detail

      • PageSize

        public PageSize​(double x,
                        double y,
                        double width,
                        double height)
      • PageSize

        public PageSize​(double width,
                        double height)
      • PageSize

        public PageSize​(java.awt.geom.Rectangle2D size)
    • Method Detail

      • getPortrait

        public PageSize getPortrait()
      • getLandscape

        public PageSize getLandscape()
      • getX

        public double getX()
      • getY

        public double getY()
      • getWidth

        public double getWidth()
      • getHeight

        public double getHeight()