public class PaperSize extends Object implements Serializable
| Modifier and Type | Field and 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 |
static PaperSize |
LEDGER |
static PaperSize |
LEGAL |
static PaperSize |
LETTER |
| Constructor and Description |
|---|
PaperSize(int width,
int height)
Constructor accepting dimensions.
|
PaperSize(String name,
int width,
int height)
Constructor accepting dimensions and name.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight() |
String |
getName() |
static PaperSize |
getStandardPaperSize(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.
|
public static final PaperSize LEDGER
public static final PaperSize LEGAL
public static final PaperSize LETTER
public static final PaperSize ARCHE
public static final PaperSize ARCHD
public static final PaperSize ARCHC
public static final PaperSize ARCHB
public static final PaperSize ARCHA
public static final PaperSize A0
public static final PaperSize A1
public static final PaperSize A2
public static final PaperSize A3
public static final PaperSize A4
public static final PaperSize A5
public static final PaperSize A6
public static final PaperSize A7
public static final PaperSize A8
public static final PaperSize A9
public static final PaperSize A10
public PaperSize(int width,
int height)
width - Widthheight - Heightpublic PaperSize(String name, int width, int height)
name - Name. If provided, considered as a standard size (will be
accessible with the getStandardPaperSize later on).width - Widthheight - Heightpublic PaperSize scale(float factor)
factor - Scale factorpublic PaperSize portrait()
public PaperSize landscape()
public static PaperSize getStandardPaperSize(String name)
name - Paper size name (not case sensitive).public int getWidth()
public int getHeight()
public String getName()
Copyright © 2016. All Rights Reserved.