PrintAttributes.MediaSize
public
static
final
class
PrintAttributes.MediaSize
extends Object
java.lang.Object | |
↳ | android.print.PrintAttributes.MediaSize |
This class specifies a supported media size. Media size is the
dimension of the media on which the content is printed. For
example, the NA_LETTER
media size designates a page
with size 8.5" x 11".
Summary
Fields | |
---|---|
public
static
final
PrintAttributes.MediaSize |
ANSI_C
North America ANSI C media size: 17" x 22" (432mm x 559mm) |
public
static
final
PrintAttributes.MediaSize |
ANSI_D
North America ANSI D media size: 22" x 34" (559mm x 864mm) |
public
static
final
PrintAttributes.MediaSize |
ANSI_E
North America ANSI E media size: 34" x 44" (864mm x 1118mm) |
public
static
final
PrintAttributes.MediaSize |
ANSI_F
North America ANSI F media size: 28" x 40" (711mm x 1016mm) |
public
static
final
PrintAttributes.MediaSize |
ISO_A0
ISO A0 media size: 841mm x 1189mm (33.11" x 46.81") |
public
static
final
PrintAttributes.MediaSize |
ISO_A1
ISO A1 media size: 594mm x 841mm (23.39" x 33.11") |
public
static
final
PrintAttributes.MediaSize |
ISO_A10
ISO A10 media size: 26mm x 37mm (1.02" x 1.46") |
public
static
final
PrintAttributes.MediaSize |
ISO_A2
ISO A2 media size: 420mm x 594mm (16.54" x 23.39") |
public
static
final
PrintAttributes.MediaSize |
ISO_A3
ISO A3 media size: 297mm x 420mm (11.69" x 16.54") |
public
static
final
PrintAttributes.MediaSize |
ISO_A4
ISO A4 media size: 210mm x 297mm (8.27" x 11.69") |
public
static
final
PrintAttributes.MediaSize |
ISO_A5
ISO A5 media size: 148mm x 210mm (5.83" x 8.27") |
public
static
final
PrintAttributes.MediaSize |
ISO_A6
ISO A6 media size: 105mm x 148mm (4.13" x 5.83") |
public
static
final
PrintAttributes.MediaSize |
ISO_A7
ISO A7 media size: 74mm x 105mm (2.91" x 4.13") |
public
static
final
PrintAttributes.MediaSize |
ISO_A8
ISO A8 media size: 52mm x 74mm (2.05" x 2.91") |
public
static
final
PrintAttributes.MediaSize |
ISO_A9
ISO A9 media size: 37mm x 52mm (1.46" x 2.05") |
public
static
final
PrintAttributes.MediaSize |
ISO_B0
ISO B0 media size: 1000mm x 1414mm (39.37" x 55.67") |
public
static
final
PrintAttributes.MediaSize |
ISO_B1
ISO B1 media size: 707mm x 1000mm (27.83" x 39.37") |
public
static
final
PrintAttributes.MediaSize |
ISO_B10
ISO B10 media size: 31mm x 44mm (1.22" x 1.73") |
public
static
final
PrintAttributes.MediaSize |
ISO_B2
ISO B2 media size: 500mm x 707mm (19.69" x 27.83") |
public
static
final
PrintAttributes.MediaSize |
ISO_B3
ISO B3 media size: 353mm x 500mm (13.90" x 19.69") |
public
static
final
PrintAttributes.MediaSize |
ISO_B4
ISO B4 media size: 250mm x 353mm (9.84" x 13.90") |
public
static
final
PrintAttributes.MediaSize |
ISO_B5
ISO B5 media size: 176mm x 250mm (6.93" x 9.84") |
public
static
final
PrintAttributes.MediaSize |
ISO_B6
ISO B6 media size: 125mm x 176mm (4.92" x 6.93") |
public
static
final
PrintAttributes.MediaSize |
ISO_B7
ISO B7 media size: 88mm x 125mm (3.46" x 4.92") |
public
static
final
PrintAttributes.MediaSize |
ISO_B8
ISO B8 media size: 62mm x 88mm (2.44" x 3.46") |
public
static
final
PrintAttributes.MediaSize |
ISO_B9
ISO B9 media size: 44mm x 62mm (1.73" x 2.44") |
public
static
final
PrintAttributes.MediaSize |
ISO_C0
ISO C0 media size: 917mm x 1297mm (36.10" x 51.06") |
public
static
final
PrintAttributes.MediaSize |
ISO_C1
ISO C1 media size: 648mm x 917mm (25.51" x 36.10") |
public
static
final
PrintAttributes.MediaSize |
ISO_C10
ISO C10 media size: 28mm x 40mm (1.10" x 1.57") |
public
static
final
PrintAttributes.MediaSize |
ISO_C2
ISO C2 media size: 458mm x 648mm (18.03" x 25.51") |
public
static
final
PrintAttributes.MediaSize |
ISO_C3
ISO C3 media size: 324mm x 458mm (12.76" x 18.03") |
public
static
final
PrintAttributes.MediaSize |
ISO_C4
ISO C4 media size: 229mm x 324mm (9.02" x 12.76") |
public
static
final
PrintAttributes.MediaSize |
ISO_C5
ISO C5 media size: 162mm x 229mm (6.38" x 9.02") |
public
static
final
PrintAttributes.MediaSize |
ISO_C6
ISO C6 media size: 114mm x 162mm (4.49" x 6.38") |
public
static
final
PrintAttributes.MediaSize |
ISO_C7
ISO C7 media size: 81mm x 114mm (3.19" x 4.49") |
public
static
final
PrintAttributes.MediaSize |
ISO_C8
ISO C8 media size: 57mm x 81mm (2.24" x 3.19") |
public
static
final
PrintAttributes.MediaSize |
ISO_C9
ISO C9 media size: 40mm x 57mm (1.57" x 2.24") |
public
static
final
PrintAttributes.MediaSize |
JIS_B0
Japanese JIS B0 media size: 1030mm x 1456mm (40.551" x 57.323") |
public
static
final
PrintAttributes.MediaSize |
JIS_B1
Japanese JIS B1 media size: 728mm x 1030mm (28.661" x 40.551") |
public
static
final
PrintAttributes.MediaSize |
JIS_B10
Japanese JIS B10 media size: 32mm x 45mm (1.259" x 1.772") |
public
static
final
PrintAttributes.MediaSize |
JIS_B2
Japanese JIS B2 media size: 515mm x 728mm (20.276" x 28.661") |
public
static
final
PrintAttributes.MediaSize |
JIS_B3
Japanese JIS B3 media size: 364mm x 515mm (14.331" x 20.276") |
public
static
final
PrintAttributes.MediaSize |
JIS_B4
Japanese JIS B4 media size: 257mm x 364mm (10.118" x 14.331") |
public
static
final
PrintAttributes.MediaSize |
JIS_B5
Japanese JIS B5 media size: 182mm x 257mm (7.165" x 10.118") |
public
static
final
PrintAttributes.MediaSize |
JIS_B6
Japanese JIS B6 media size: 128mm x 182mm (5.049" x 7.165") |
public
static
final
PrintAttributes.MediaSize |
JIS_B7
Japanese JIS B7 media size: 91mm x 128mm (3.583" x 5.049") |
public
static
final
PrintAttributes.MediaSize |
JIS_B8
Japanese JIS B8 media size: 64mm x 91mm (2.52" x 3.583") |
public
static
final
PrintAttributes.MediaSize |
JIS_B9
Japanese JIS B9 media size: 45mm x 64mm (1.772" x 2.52") |
public
static
final
PrintAttributes.MediaSize |
JIS_EXEC
Japanese JIS Exec media size: 216mm x 330mm (8.504" x 12.992") |
public
static
final
PrintAttributes.MediaSize |
JPN_CHOU2
Japanese Chou2 media size: 111.1mm x 146mm (4.374" x 5.748") |
public
static
final
PrintAttributes.MediaSize |
JPN_CHOU3
Japanese Chou3 media size: 120mm x 235mm (4.724" x 9.252") |
public
static
final
PrintAttributes.MediaSize |
JPN_CHOU4
Japanese Chou4 media size: 90mm x 205mm (3.543" x 8.071") |
public
static
final
PrintAttributes.MediaSize |
JPN_HAGAKI
Japanese Hagaki media size: 100mm x 148mm (3.937" x 5.827") |
public
static
final
PrintAttributes.MediaSize |
JPN_KAHU
Japanese Kahu media size: 240mm x 322.1mm (9.449" x 12.681") |
public
static
final
PrintAttributes.MediaSize |
JPN_KAKU2
Japanese Kaku2 media size: 240mm x 332mm (9.449" x 13.071") |
public
static
final
PrintAttributes.MediaSize |
JPN_OE_PHOTO_L
Japanese Photo L media size: 89mm x 127mm (3.5 x 5") |
public
static
final
PrintAttributes.MediaSize |
JPN_OUFUKU
Japanese Oufuku media size: 148mm x 200mm (5.827" x 7.874") |
public
static
final
PrintAttributes.MediaSize |
JPN_YOU4
Japanese You4 media size: 105mm x 235mm (4.134" x 9.252") |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_A
North America Arch A media size: 9" x 12" (229mm x 305mm) |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_B
North America Arch B media size: 12" x 18" (305mm x 457mm) |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_C
North America Arch C media size: 18" x 24" (457mm x 610mm) |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_D
North America Arch D media size: 24" x 36" (610mm x 914mm) |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_E
North America Arch E media size: 36" x 48" (914mm x 1219mm) |
public
static
final
PrintAttributes.MediaSize |
NA_ARCH_E1
North America Arch E1 media size: 30" x 42" (762mm x 1067mm) |
public
static
final
PrintAttributes.MediaSize |
NA_FOOLSCAP
North America Foolscap media size: 8" x 13" (203mm x 330mm) |
public
static
final
PrintAttributes.MediaSize |
NA_GOVT_LETTER
North America Government-Letter media size: 8.0" x 10.5" (203mm x 267mm) |
public
static
final
PrintAttributes.MediaSize |
NA_INDEX_3X5
North America Index Card 3x5 media size: 3" x 5" (76mm x 127mm) |
public
static
final
PrintAttributes.MediaSize |
NA_INDEX_4X6
North America Index Card 4x6 media size: 4" x 6" (102mm x 152mm) |
public
static
final
PrintAttributes.MediaSize |
NA_INDEX_5X8
North America Index Card 5x8 media size: 5" x 8" (127mm x 203mm) |
public
static
final
PrintAttributes.MediaSize |
NA_JUNIOR_LEGAL
North America Junior Legal media size: 8.0" x 5.0" (203mm × 127mm) |
public
static
final
PrintAttributes.MediaSize |
NA_LEDGER
North America Ledger media size: 17" x 11" (432mm × 279mm) |
public
static
final
PrintAttributes.MediaSize |
NA_LEGAL
North America Legal media size: 8.5" x 14" (216mm x 356mm) |
public
static
final
PrintAttributes.MediaSize |
NA_LETTER
North America Letter media size: 8.5" x 11" (279mm x 216mm) |
public
static
final
PrintAttributes.MediaSize |
NA_MONARCH
North America Monarch media size: 7.25" x 10.5" (184mm x 267mm) |
public
static
final
PrintAttributes.MediaSize |
NA_QUARTO
North America Quarto media size: 8" x 10" (203mm x 254mm) |
public
static
final
PrintAttributes.MediaSize |
NA_SUPER_B
North America Super B media size: 13" x 19" (330mm x 483mm) |
public
static
final
PrintAttributes.MediaSize |
NA_TABLOID
North America Tabloid media size: 11" x 17" (279mm × 432mm) |
public
static
final
PrintAttributes.MediaSize |
OM_DAI_PA_KAI
Chinese Dai Pa Kai media size: 275mm x 395mm (10.827" x 15.551") |
public
static
final
PrintAttributes.MediaSize |
OM_JUURO_KU_KAI
Chinese Jurro Ku Kai media size: 198mm x 275mm (7.796" x 10.827") |
public
static
final
PrintAttributes.MediaSize |
OM_PA_KAI
Chinese Pa Kai media size: 267mm x 389mm (10.512" x 15.315") |
public
static
final
PrintAttributes.MediaSize |
PRC_1
Chinese PRC 1 media size: 102mm x 165mm (4.015" x 6.496") |
public
static
final
PrintAttributes.MediaSize |
PRC_10
Chinese PRC 10 media size: 324mm x 458mm (12.756" x 18.032") |
public
static
final
PrintAttributes.MediaSize |
PRC_16K
Chinese PRC 16k media size: 146mm x 215mm (5.749" x 8.465") |
public
static
final
PrintAttributes.MediaSize |
PRC_2
Chinese PRC 2 media size: 102mm x 176mm (4.015" x 6.929") |
public
static
final
PrintAttributes.MediaSize |
PRC_3
Chinese PRC 3 media size: 125mm x 176mm (4.921" x 6.929") |
public
static
final
PrintAttributes.MediaSize |
PRC_4
Chinese PRC 4 media size: 110mm x 208mm (4.330" x 8.189") |
public
static
final
PrintAttributes.MediaSize |
PRC_5
Chinese PRC 5 media size: 110mm x 220mm (4.330" x 8.661") |
public
static
final
PrintAttributes.MediaSize |
PRC_6
Chinese PRC 6 media size: 120mm x 320mm (4.724" x 12.599") |
public
static
final
PrintAttributes.MediaSize |
PRC_7
Chinese PRC 7 media size: 160mm x 230mm (6.299" x 9.055") |
public
static
final
PrintAttributes.MediaSize |
PRC_8
Chinese PRC 8 media size: 120mm x 309mm (4.724" x 12.165") |
public
static
final
PrintAttributes.MediaSize |
PRC_9
Chinese PRC 9 media size: 229mm x 324mm (9.016" x 12.756") |
public
static
final
PrintAttributes.MediaSize |
ROC_16K
Chinese ROC 16K media size: 195mm x 270mm (7.677" x 10.629") |
public
static
final
PrintAttributes.MediaSize |
ROC_8K
Chinese ROC 8K media size: 270mm x 390mm (10.629" x 15.3543") |
public
static
final
PrintAttributes.MediaSize |
UNKNOWN_LANDSCAPE
Unknown media size in landscape mode. |
public
static
final
PrintAttributes.MediaSize |
UNKNOWN_PORTRAIT
Unknown media size in portrait mode. |
Public constructors | |
---|---|
MediaSize(String id, String label, int widthMils, int heightMils)
Creates a new instance. |
Public methods | |
---|---|
PrintAttributes.MediaSize
|
asLandscape()
Returns a new media size instance in a landscape orientation, which is the height is the lesser dimension. |
PrintAttributes.MediaSize
|
asPortrait()
Returns a new media size instance in a portrait orientation, which is the height is the greater dimension. |
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
int
|
getHeightMils()
Gets the media height in mils (thousandths of an inch). |
String
|
getId()
Gets the unique media size id. |
String
|
getLabel(PackageManager packageManager)
Gets the human readable media size label. |
int
|
getWidthMils()
Gets the media width in mils (thousandths of an inch). |
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isPortrait()
Gets whether this media size is in portrait which is the height is greater or equal to the width. |
String
|
toString()
Returns a string representation of the object. |
Inherited methods | |
---|---|
Fields
ANSI_C
public static final PrintAttributes.MediaSize ANSI_C
North America ANSI C media size: 17" x 22" (432mm x 559mm)
ANSI_D
public static final PrintAttributes.MediaSize ANSI_D
North America ANSI D media size: 22" x 34" (559mm x 864mm)
ANSI_E
public static final PrintAttributes.MediaSize ANSI_E
North America ANSI E media size: 34" x 44" (864mm x 1118mm)
ANSI_F
public static final PrintAttributes.MediaSize ANSI_F
North America ANSI F media size: 28" x 40" (711mm x 1016mm)
ISO_A0
public static final PrintAttributes.MediaSize ISO_A0
ISO A0 media size: 841mm x 1189mm (33.11" x 46.81")
ISO_A1
public static final PrintAttributes.MediaSize ISO_A1
ISO A1 media size: 594mm x 841mm (23.39" x 33.11")
ISO_A10
public static final PrintAttributes.MediaSize ISO_A10
ISO A10 media size: 26mm x 37mm (1.02" x 1.46")
ISO_A2
public static final PrintAttributes.MediaSize ISO_A2
ISO A2 media size: 420mm x 594mm (16.54" x 23.39")
ISO_A3
public static final PrintAttributes.MediaSize ISO_A3
ISO A3 media size: 297mm x 420mm (11.69" x 16.54")
ISO_A4
public static final PrintAttributes.MediaSize ISO_A4
ISO A4 media size: 210mm x 297mm (8.27" x 11.69")
ISO_A5
public static final PrintAttributes.MediaSize ISO_A5
ISO A5 media size: 148mm x 210mm (5.83" x 8.27")
ISO_A6
public static final PrintAttributes.MediaSize ISO_A6
ISO A6 media size: 105mm x 148mm (4.13" x 5.83")
ISO_A7
public static final PrintAttributes.MediaSize ISO_A7
ISO A7 media size: 74mm x 105mm (2.91" x 4.13")
ISO_A8
public static final PrintAttributes.MediaSize ISO_A8
ISO A8 media size: 52mm x 74mm (2.05" x 2.91")
ISO_A9
public static final PrintAttributes.MediaSize ISO_A9
ISO A9 media size: 37mm x 52mm (1.46" x 2.05")
ISO_B0
public static final PrintAttributes.MediaSize ISO_B0
ISO B0 media size: 1000mm x 1414mm (39.37" x 55.67")
ISO_B1
public static final PrintAttributes.MediaSize ISO_B1
ISO B1 media size: 707mm x 1000mm (27.83" x 39.37")
ISO_B10
public static final PrintAttributes.MediaSize ISO_B10
ISO B10 media size: 31mm x 44mm (1.22" x 1.73")
ISO_B2
public static final PrintAttributes.MediaSize ISO_B2
ISO B2 media size: 500mm x 707mm (19.69" x 27.83")
ISO_B3
public static final PrintAttributes.MediaSize ISO_B3
ISO B3 media size: 353mm x 500mm (13.90" x 19.69")
ISO_B4
public static final PrintAttributes.MediaSize ISO_B4
ISO B4 media size: 250mm x 353mm (9.84" x 13.90")
ISO_B5
public static final PrintAttributes.MediaSize ISO_B5
ISO B5 media size: 176mm x 250mm (6.93" x 9.84")
ISO_B6
public static final PrintAttributes.MediaSize ISO_B6
ISO B6 media size: 125mm x 176mm (4.92" x 6.93")
ISO_B7
public static final PrintAttributes.MediaSize ISO_B7
ISO B7 media size: 88mm x 125mm (3.46" x 4.92")
ISO_B8
public static final PrintAttributes.MediaSize ISO_B8
ISO B8 media size: 62mm x 88mm (2.44" x 3.46")
ISO_B9
public static final PrintAttributes.MediaSize ISO_B9
ISO B9 media size: 44mm x 62mm (1.73" x 2.44")
ISO_C0
public static final PrintAttributes.MediaSize ISO_C0
ISO C0 media size: 917mm x 1297mm (36.10" x 51.06")
ISO_C1
public static final PrintAttributes.MediaSize ISO_C1
ISO C1 media size: 648mm x 917mm (25.51" x 36.10")
ISO_C10
public static final PrintAttributes.MediaSize ISO_C10
ISO C10 media size: 28mm x 40mm (1.10" x 1.57")
ISO_C2
public static final PrintAttributes.MediaSize ISO_C2
ISO C2 media size: 458mm x 648mm (18.03" x 25.51")
ISO_C3
public static final PrintAttributes.MediaSize ISO_C3
ISO C3 media size: 324mm x 458mm (12.76" x 18.03")
ISO_C4
public static final PrintAttributes.MediaSize ISO_C4
ISO C4 media size: 229mm x 324mm (9.02" x 12.76")
ISO_C5
public static final PrintAttributes.MediaSize ISO_C5
ISO C5 media size: 162mm x 229mm (6.38" x 9.02")
ISO_C6
public static final PrintAttributes.MediaSize ISO_C6
ISO C6 media size: 114mm x 162mm (4.49" x 6.38")
ISO_C7
public static final PrintAttributes.MediaSize ISO_C7
ISO C7 media size: 81mm x 114mm (3.19" x 4.49")
ISO_C8
public static final PrintAttributes.MediaSize ISO_C8
ISO C8 media size: 57mm x 81mm (2.24" x 3.19")
ISO_C9
public static final PrintAttributes.MediaSize ISO_C9
ISO C9 media size: 40mm x 57mm (1.57" x 2.24")
JIS_B0
public static final PrintAttributes.MediaSize JIS_B0
Japanese JIS B0 media size: 1030mm x 1456mm (40.551" x 57.323")
JIS_B1
public static final PrintAttributes.MediaSize JIS_B1
Japanese JIS B1 media size: 728mm x 1030mm (28.661" x 40.551")
JIS_B10
public static final PrintAttributes.MediaSize JIS_B10
Japanese JIS B10 media size: 32mm x 45mm (1.259" x 1.772")
JIS_B2
public static final PrintAttributes.MediaSize JIS_B2
Japanese JIS B2 media size: 515mm x 728mm (20.276" x 28.661")
JIS_B3
public static final PrintAttributes.MediaSize JIS_B3
Japanese JIS B3 media size: 364mm x 515mm (14.331" x 20.276")
JIS_B4
public static final PrintAttributes.MediaSize JIS_B4
Japanese JIS B4 media size: 257mm x 364mm (10.118" x 14.331")
JIS_B5
public static final PrintAttributes.MediaSize JIS_B5
Japanese JIS B5 media size: 182mm x 257mm (7.165" x 10.118")
JIS_B6
public static final PrintAttributes.MediaSize JIS_B6
Japanese JIS B6 media size: 128mm x 182mm (5.049" x 7.165")
JIS_B7
public static final PrintAttributes.MediaSize JIS_B7
Japanese JIS B7 media size: 91mm x 128mm (3.583" x 5.049")
JIS_B8
public static final PrintAttributes.MediaSize JIS_B8
Japanese JIS B8 media size: 64mm x 91mm (2.52" x 3.583")
JIS_B9
public static final PrintAttributes.MediaSize JIS_B9
Japanese JIS B9 media size: 45mm x 64mm (1.772" x 2.52")
JIS_EXEC
public static final PrintAttributes.MediaSize JIS_EXEC
Japanese JIS Exec media size: 216mm x 330mm (8.504" x 12.992")
JPN_CHOU2
public static final PrintAttributes.MediaSize JPN_CHOU2
Japanese Chou2 media size: 111.1mm x 146mm (4.374" x 5.748")
JPN_CHOU3
public static final PrintAttributes.MediaSize JPN_CHOU3
Japanese Chou3 media size: 120mm x 235mm (4.724" x 9.252")
JPN_CHOU4
public static final PrintAttributes.MediaSize JPN_CHOU4
Japanese Chou4 media size: 90mm x 205mm (3.543" x 8.071")
JPN_HAGAKI
public static final PrintAttributes.MediaSize JPN_HAGAKI
Japanese Hagaki media size: 100mm x 148mm (3.937" x 5.827")
JPN_KAHU
public static final PrintAttributes.MediaSize JPN_KAHU
Japanese Kahu media size: 240mm x 322.1mm (9.449" x 12.681")
JPN_KAKU2
public static final PrintAttributes.MediaSize JPN_KAKU2
Japanese Kaku2 media size: 240mm x 332mm (9.449" x 13.071")
JPN_OE_PHOTO_L
public static final PrintAttributes.MediaSize JPN_OE_PHOTO_L
Japanese Photo L media size: 89mm x 127mm (3.5 x 5")
JPN_OUFUKU
public static final PrintAttributes.MediaSize JPN_OUFUKU
Japanese Oufuku media size: 148mm x 200mm (5.827" x 7.874")
JPN_YOU4
public static final PrintAttributes.MediaSize JPN_YOU4
Japanese You4 media size: 105mm x 235mm (4.134" x 9.252")
NA_ARCH_A
public static final PrintAttributes.MediaSize NA_ARCH_A
North America Arch A media size: 9" x 12" (229mm x 305mm)
NA_ARCH_B
public static final PrintAttributes.MediaSize NA_ARCH_B
North America Arch B media size: 12" x 18" (305mm x 457mm)
NA_ARCH_C
public static final PrintAttributes.MediaSize NA_ARCH_C
North America Arch C media size: 18" x 24" (457mm x 610mm)
NA_ARCH_D
public static final PrintAttributes.MediaSize NA_ARCH_D
North America Arch D media size: 24" x 36" (610mm x 914mm)
NA_ARCH_E
public static final PrintAttributes.MediaSize NA_ARCH_E
North America Arch E media size: 36" x 48" (914mm x 1219mm)
NA_ARCH_E1
public static final PrintAttributes.MediaSize NA_ARCH_E1
North America Arch E1 media size: 30" x 42" (762mm x 1067mm)
NA_FOOLSCAP
public static final PrintAttributes.MediaSize NA_FOOLSCAP
North America Foolscap media size: 8" x 13" (203mm x 330mm)
NA_GOVT_LETTER
public static final PrintAttributes.MediaSize NA_GOVT_LETTER
North America Government-Letter media size: 8.0" x 10.5" (203mm x 267mm)
NA_INDEX_3X5
public static final PrintAttributes.MediaSize NA_INDEX_3X5
North America Index Card 3x5 media size: 3" x 5" (76mm x 127mm)
NA_INDEX_4X6
public static final PrintAttributes.MediaSize NA_INDEX_4X6
North America Index Card 4x6 media size: 4" x 6" (102mm x 152mm)
NA_INDEX_5X8
public static final PrintAttributes.MediaSize NA_INDEX_5X8
North America Index Card 5x8 media size: 5" x 8" (127mm x 203mm)
NA_JUNIOR_LEGAL
public static final PrintAttributes.MediaSize NA_JUNIOR_LEGAL
North America Junior Legal media size: 8.0" x 5.0" (203mm × 127mm)
NA_LEDGER
public static final PrintAttributes.MediaSize NA_LEDGER
North America Ledger media size: 17" x 11" (432mm × 279mm)
NA_LEGAL
public static final PrintAttributes.MediaSize NA_LEGAL
North America Legal media size: 8.5" x 14" (216mm x 356mm)
NA_LETTER
public static final PrintAttributes.MediaSize NA_LETTER
North America Letter media size: 8.5" x 11" (279mm x 216mm)
NA_MONARCH
public static final PrintAttributes.MediaSize NA_MONARCH
North America Monarch media size: 7.25" x 10.5" (184mm x 267mm)
NA_QUARTO
public static final PrintAttributes.MediaSize NA_QUARTO
North America Quarto media size: 8" x 10" (203mm x 254mm)
NA_SUPER_B
public static final PrintAttributes.MediaSize NA_SUPER_B
North America Super B media size: 13" x 19" (330mm x 483mm)
NA_TABLOID
public static final PrintAttributes.MediaSize NA_TABLOID
North America Tabloid media size: 11" x 17" (279mm × 432mm)
OM_DAI_PA_KAI
public static final PrintAttributes.MediaSize OM_DAI_PA_KAI
Chinese Dai Pa Kai media size: 275mm x 395mm (10.827" x 15.551")
OM_JUURO_KU_KAI
public static final PrintAttributes.MediaSize OM_JUURO_KU_KAI
Chinese Jurro Ku Kai media size: 198mm x 275mm (7.796" x 10.827")
OM_PA_KAI
public static final PrintAttributes.MediaSize OM_PA_KAI
Chinese Pa Kai media size: 267mm x 389mm (10.512" x 15.315")
PRC_1
public static final PrintAttributes.MediaSize PRC_1
Chinese PRC 1 media size: 102mm x 165mm (4.015" x 6.496")
PRC_10
public static final PrintAttributes.MediaSize PRC_10
Chinese PRC 10 media size: 324mm x 458mm (12.756" x 18.032")
PRC_16K
public static final PrintAttributes.MediaSize PRC_16K
Chinese PRC 16k media size: 146mm x 215mm (5.749" x 8.465")
PRC_2
public static final PrintAttributes.MediaSize PRC_2
Chinese PRC 2 media size: 102mm x 176mm (4.015" x 6.929")
PRC_3
public static final PrintAttributes.MediaSize PRC_3
Chinese PRC 3 media size: 125mm x 176mm (4.921" x 6.929")
PRC_4
public static final PrintAttributes.MediaSize PRC_4
Chinese PRC 4 media size: 110mm x 208mm (4.330" x 8.189")
PRC_5
public static final PrintAttributes.MediaSize PRC_5
Chinese PRC 5 media size: 110mm x 220mm (4.330" x 8.661")
PRC_6
public static final PrintAttributes.MediaSize PRC_6
Chinese PRC 6 media size: 120mm x 320mm (4.724" x 12.599")
PRC_7
public static final PrintAttributes.MediaSize PRC_7
Chinese PRC 7 media size: 160mm x 230mm (6.299" x 9.055")
PRC_8
public static final PrintAttributes.MediaSize PRC_8
Chinese PRC 8 media size: 120mm x 309mm (4.724" x 12.165")
PRC_9
public static final PrintAttributes.MediaSize PRC_9
Chinese PRC 9 media size: 229mm x 324mm (9.016" x 12.756")
ROC_16K
public static final PrintAttributes.MediaSize ROC_16K
Chinese ROC 16K media size: 195mm x 270mm (7.677" x 10.629")
ROC_8K
public static final PrintAttributes.MediaSize ROC_8K
Chinese ROC 8K media size: 270mm x 390mm (10.629" x 15.3543")
UNKNOWN_LANDSCAPE
public static final PrintAttributes.MediaSize UNKNOWN_LANDSCAPE
Unknown media size in landscape mode.
Note: This is for specifying orientation without media size. You should not use the dimensions reported by this instance.
UNKNOWN_PORTRAIT
public static final PrintAttributes.MediaSize UNKNOWN_PORTRAIT
Unknown media size in portrait mode.
Note: This is for specifying orientation without media size. You should not use the dimensions reported by this instance.
Public constructors
MediaSize
public MediaSize (String id, String label, int widthMils, int heightMils)
Creates a new instance.
Parameters | |
---|---|
id |
String : The unique media size id. It is unique amongst other media sizes
supported by the printer.
This value cannot be null . |
label |
String : The localized human readable label.
This value cannot be null . |
widthMils |
int : The width in mils (thousandths of an inch).
Value is 1 or greater |
heightMils |
int : The height in mils (thousandths of an inch).
Value is 1 or greater |
Throws | |
---|---|
IllegalArgumentException |
If the id is empty or the label is empty or the widthMils is less than or equal to zero or the heightMils is less than or equal to zero. |
Public methods
asLandscape
public PrintAttributes.MediaSize asLandscape ()
Returns a new media size instance in a landscape orientation, which is the height is the lesser dimension.
Returns | |
---|---|
PrintAttributes.MediaSize |
New instance in landscape orientation if this one
is in portrait, otherwise this instance.
This value cannot be null . |
asPortrait
public PrintAttributes.MediaSize asPortrait ()
Returns a new media size instance in a portrait orientation, which is the height is the greater dimension.
Returns | |
---|---|
PrintAttributes.MediaSize |
New instance in landscape orientation if this one
is in landscape, otherwise this instance.
This value cannot be null . |
equals
public boolean equals (Object obj)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
obj |
Object : This value may be null . |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
getHeightMils
public int getHeightMils ()
Gets the media height in mils (thousandths of an inch).
Returns | |
---|---|
int |
The media height. Value is 1 or greater |
getId
public String getId ()
Gets the unique media size id. It is unique amongst other media sizes supported by the printer.
This id is defined by the client that generated the media size instance and should not be interpreted by other parties.
Returns | |
---|---|
String |
The unique media size id.
This value cannot be null . |
getLabel
public String getLabel (PackageManager packageManager)
Gets the human readable media size label.
Parameters | |
---|---|
packageManager |
PackageManager : The package manager for loading the label.
This value cannot be null . |
Returns | |
---|---|
String |
The human readable label.
This value cannot be null . |
getWidthMils
public int getWidthMils ()
Gets the media width in mils (thousandths of an inch).
Returns | |
---|---|
int |
The media width. Value is 1 or greater |
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
- Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals
method, then calling thehashCode
method on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal
according to the
equals
method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns | |
---|---|
int |
a hash code value for this object. |
isPortrait
public boolean isPortrait ()
Gets whether this media size is in portrait which is the height is greater or equal to the width.
Returns | |
---|---|
boolean |
True if the media size is in portrait, false if it is in landscape. |
toString
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |