Package org.ghost4j.document
Class PaperSize
- java.lang.Object
-
- org.ghost4j.document.PaperSize
-
- All Implemented Interfaces:
java.io.Serializable
public class PaperSize extends java.lang.Object implements java.io.Serializable
Defines a paper size. Standard sizes are defined as constants. Check http://ghostscript.com/doc/current/Use.htm#Known_paper_sizes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static PaperSize
A0
static PaperSize
A1
static PaperSize
A10
static PaperSize
A2
static PaperSize
A3
static PaperSize
A4
static PaperSize
A5
static PaperSize
A6
static PaperSize
A7
static PaperSize
A8
static PaperSize
A9
static PaperSize
ARCHA
static PaperSize
ARCHB
static PaperSize
ARCHC
static PaperSize
ARCHD
static PaperSize
ARCHE
private int
height
Paper height in points.private static java.util.Map<java.lang.String,PaperSize>
index
Standard paper sizes index map.static PaperSize
LEDGER
static PaperSize
LEGAL
static PaperSize
LETTER
private java.lang.String
name
Paper name (if standard paper size)private static long
serialVersionUID
Serial UID.private int
width
Paper width in points.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getHeight()
java.lang.String
getName()
static PaperSize
getStandardPaperSize(java.lang.String name)
Looks for a standard paper size with a given name.int
getWidth()
PaperSize
landscape()
Returns a landscape orientation of the PaperSize.PaperSize
portrait()
Returns a portrait orientation of the PaperSize.PaperSize
scale(float factor)
Returns a scaled PaperSize according to a scale factor.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial UID.- See Also:
- Constant Field Values
-
index
private static final java.util.Map<java.lang.String,PaperSize> index
Standard paper sizes index map. Allows faster paer size lookup by name.
-
LEDGER
public static final PaperSize LEDGER
-
LEGAL
public static final PaperSize LEGAL
-
LETTER
public static final PaperSize LETTER
-
ARCHE
public static final PaperSize ARCHE
-
ARCHD
public static final PaperSize ARCHD
-
ARCHC
public static final PaperSize ARCHC
-
ARCHB
public static final PaperSize ARCHB
-
ARCHA
public static final PaperSize ARCHA
-
A0
public static final PaperSize A0
-
A1
public static final PaperSize A1
-
A2
public static final PaperSize A2
-
A3
public static final PaperSize A3
-
A4
public static final PaperSize A4
-
A5
public static final PaperSize A5
-
A6
public static final PaperSize A6
-
A7
public static final PaperSize A7
-
A8
public static final PaperSize A8
-
A9
public static final PaperSize A9
-
A10
public static final PaperSize A10
-
width
private final int width
Paper width in points.
-
height
private final int height
Paper height in points.
-
name
private java.lang.String name
Paper name (if standard paper size)
-
-
Constructor Detail
-
PaperSize
public PaperSize(int width, int height)
Constructor accepting dimensions.- Parameters:
width
- Widthheight
- Height
-
PaperSize
public PaperSize(java.lang.String name, int width, int height)
Constructor accepting dimensions and name.- Parameters:
name
- Name. If provided, considered as a standard size (will be accessible with the getStandardPaperSize later on).width
- Widthheight
- Height
-
-
Method Detail
-
scale
public PaperSize scale(float factor)
Returns a scaled PaperSize according to a scale factor.- Parameters:
factor
- Scale factor- Returns:
- Scaled PaperSize
-
portrait
public PaperSize portrait()
Returns a portrait orientation of the PaperSize.- Returns:
- A PaperSize.
-
landscape
public PaperSize landscape()
Returns a landscape orientation of the PaperSize.- Returns:
- A PaperSize.
-
getStandardPaperSize
public static PaperSize getStandardPaperSize(java.lang.String name)
Looks for a standard paper size with a given name.- Parameters:
name
- Paper size name (not case sensitive).- Returns:
- PaperSize found or null
-
getWidth
public int getWidth()
-
getHeight
public int getHeight()
-
getName
public java.lang.String getName()
-
-