Package org.ghost4j.document
Class PaperSize
java.lang.Object
org.ghost4j.document.PaperSize
- All Implemented Interfaces:
Serializable
Defines a paper size. Standard sizes are defined as constants. Check
http://ghostscript.com/doc/current/Use.htm#Known_paper_sizes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
static final PaperSize
private final int
Paper height in points.Standard paper sizes index map.static final PaperSize
static final PaperSize
static final PaperSize
private String
Paper name (if standard paper size)private static final long
Serial UID.private final int
Paper width in points. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getName()
static PaperSize
getStandardPaperSize
(String name) Looks for a standard paper size with a given name.int
getWidth()
Returns a landscape orientation of the PaperSize.portrait()
Returns a portrait orientation of the PaperSize.scale
(float factor) Returns a scaled PaperSize according to a scale factor.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial UID.- See Also:
-
index
Standard paper sizes index map. Allows faster paer size lookup by name. -
LEDGER
-
LEGAL
-
LETTER
-
ARCHE
-
ARCHD
-
ARCHC
-
ARCHB
-
ARCHA
-
A0
-
A1
-
A2
-
A3
-
A4
-
A5
-
A6
-
A7
-
A8
-
A9
-
A10
-
width
private final int widthPaper width in points. -
height
private final int heightPaper height in points. -
name
Paper name (if standard paper size)
-
-
Constructor Details
-
PaperSize
public PaperSize(int width, int height) Constructor accepting dimensions.- Parameters:
width
- Widthheight
- Height
-
PaperSize
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 Details
-
scale
Returns a scaled PaperSize according to a scale factor.- Parameters:
factor
- Scale factor- Returns:
- Scaled PaperSize
-
portrait
Returns a portrait orientation of the PaperSize.- Returns:
- A PaperSize.
-
landscape
Returns a landscape orientation of the PaperSize.- Returns:
- A PaperSize.
-
getStandardPaperSize
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
-