Most visited

Recently visited

Added in API level 19

PrintAttributes.MediaSize

public static final class PrintAttributes.MediaSize
extends Object

java.lang.Object
   ↳ android.print.PrintAttributes.MediaSize


此类指定支持的媒体大小。 介质尺寸是打印内容的介质的尺寸。 例如, NA_LETTER媒体大小指定一个大小为8.5“x 11”的页面。

Summary

Fields

public static final PrintAttributes.MediaSize ISO_A0

ISO A0介质尺寸:841mm x 1189mm(33.11“x 46.81”)

public static final PrintAttributes.MediaSize ISO_A1

ISO A1介质尺寸:594mm x 841mm(23.39“x 33.11”)

public static final PrintAttributes.MediaSize ISO_A10

ISO A10介质尺寸:26mm x 37mm(1.02“x 1.46”)

public static final PrintAttributes.MediaSize ISO_A2

ISO A2介质尺寸:420mm x 594mm(16.54“x 23.39”)

public static final PrintAttributes.MediaSize ISO_A3

ISO A3介质尺寸:297mm x 420mm(11.69“x 16.54”)

public static final PrintAttributes.MediaSize ISO_A4

ISO A4介质尺寸:210mm x 297mm(8.27“x 11.69”)

public static final PrintAttributes.MediaSize ISO_A5

ISO A5介质尺寸:148mm x 210mm(5.83“x 8.27”)

public static final PrintAttributes.MediaSize ISO_A6

ISO A6介质尺寸:105mm x 148mm(4.13“x 5.83”)

public static final PrintAttributes.MediaSize ISO_A7

ISO A7介质尺寸:74mm x 105mm(2.91“x 4.13”)

public static final PrintAttributes.MediaSize ISO_A8

ISO A8介质尺寸:52mm x 74mm(2.05“x 2.91”)

public static final PrintAttributes.MediaSize ISO_A9

ISO A9介质尺寸:37mm x 52mm(1.46“x 2.05”)

public static final PrintAttributes.MediaSize ISO_B0

ISO B0介质尺寸:1000mm x 1414mm(39.37“x 55.67”)

public static final PrintAttributes.MediaSize ISO_B1

ISO B1介质尺寸:707mm x 1000mm(27.83“x 39.37”)

public static final PrintAttributes.MediaSize ISO_B10

ISO B10介质尺寸:31mm x 44mm(1.22“x 1.73”)

public static final PrintAttributes.MediaSize ISO_B2

ISO B2介质尺寸:500mm x 707mm(19.69“x 27.83”)

public static final PrintAttributes.MediaSize ISO_B3

ISO B3介质尺寸:353mm x 500mm(13.90“x 19.69”)

public static final PrintAttributes.MediaSize ISO_B4

ISO B4介质尺寸:250mm x 353mm(9.84“x 13.90”)

public static final PrintAttributes.MediaSize ISO_B5

ISO B5介质尺寸:176毫米x 250毫米(6.93英寸x 9.84英寸)

public static final PrintAttributes.MediaSize ISO_B6

ISO B6介质尺寸:125mm x 176mm(4.92“x 6.93”)

public static final PrintAttributes.MediaSize ISO_B7

ISO B7介质尺寸:88mm x 125mm(3.46“x 4.92”)

public static final PrintAttributes.MediaSize ISO_B8

ISO B8介质尺寸:62毫米x 88毫米(2.44英寸x 3.46英寸)

public static final PrintAttributes.MediaSize ISO_B9

ISO B9介质尺寸:44mm x 62mm(1.73“x 2.44”)

public static final PrintAttributes.MediaSize ISO_C0

ISO C0介质尺寸:917mm x 1297mm(36.10“x 51.06”)

public static final PrintAttributes.MediaSize ISO_C1

ISO C1介质尺寸:648mm x 917mm(25.51“x 36.10”)

public static final PrintAttributes.MediaSize ISO_C10

ISO C10介质尺寸:28mm x 40mm(1.10“x 1.57”)

public static final PrintAttributes.MediaSize ISO_C2

ISO C2介质尺寸:458mm x 648mm(18.03“x 25.51”)

public static final PrintAttributes.MediaSize ISO_C3

ISO C3介质尺寸:324mm x 458mm(12.76“x 18.03”)

public static final PrintAttributes.MediaSize ISO_C4

ISO C4介质尺寸:229mm x 324mm(9.02“x 12.76”)

public static final PrintAttributes.MediaSize ISO_C5

ISO C5介质尺寸:162mm x 229mm(6.38“x 9.02”)

public static final PrintAttributes.MediaSize ISO_C6

ISO C6介质尺寸:114mm x 162mm(4.49“x 6.38”)

public static final PrintAttributes.MediaSize ISO_C7

ISO C7介质尺寸:81mm x 114mm(3.19“x 4.49”)

public static final PrintAttributes.MediaSize ISO_C8

ISO C8介质尺寸:57mm x 81mm(2.24“x 3.19”)

public static final PrintAttributes.MediaSize ISO_C9

ISO C9介质尺寸:40mm x 57mm(1.57“x 2.24”)

public static final PrintAttributes.MediaSize JIS_B0

日本JIS B0介质尺寸:1030mm×1456mm(40.551“×57.323”)

public static final PrintAttributes.MediaSize JIS_B1

日本JIS B1介质尺寸:728mm×1030mm(28.661“×40.551”)

public static final PrintAttributes.MediaSize JIS_B10

日本JIS B10介质尺寸:32mm x 45mm(1.259“x 1.772”)

public static final PrintAttributes.MediaSize JIS_B2

日本JIS B2介质尺寸:515mm x 728mm(20.276“x 28.661”)

public static final PrintAttributes.MediaSize JIS_B3

日本JIS B3介质尺寸:364mm×515mm(14.331“×20.276”)

public static final PrintAttributes.MediaSize JIS_B4

日本JIS B4介质尺寸:257mm×364mm(10.118“×14.331”)

public static final PrintAttributes.MediaSize JIS_B5

日本JIS B5介质尺寸:182mm×257mm(7.165“×10.118”)

public static final PrintAttributes.MediaSize JIS_B6

日本JIS B6介质尺寸:128mm x 182mm(5.049“x 7.165”)

public static final PrintAttributes.MediaSize JIS_B7

日本JIS B7介质尺寸:91mm x 128mm(3.583“x 5.049”)

public static final PrintAttributes.MediaSize JIS_B8

日本JIS B8介质尺寸:64mm×91mm(2.52“×3.583”)

public static final PrintAttributes.MediaSize JIS_B9

日本JIS B9介质尺寸:45mm×64mm(1.772“×2.52”)

public static final PrintAttributes.MediaSize JIS_EXEC

日本JIS Exec介质尺寸:216mm x 330mm(8.504“x 12.992”)

public static final PrintAttributes.MediaSize JPN_CHOU2

日本Chou2媒体尺寸:111.1mm x 146mm(4.374“x 5.748”)

public static final PrintAttributes.MediaSize JPN_CHOU3

日本Chou3媒体大小:120mm x 235mm(4.724“x 9.252”)

public static final PrintAttributes.MediaSize JPN_CHOU4

日本Chou4媒体尺寸:90mm x 205mm(3.543“x 8.071”)

public static final PrintAttributes.MediaSize JPN_HAGAKI

日本Hagaki媒体大小:100mm x 148mm(3.937“x 5.827”)

public static final PrintAttributes.MediaSize JPN_KAHU

日本Kahu媒体大小:240mm x 322.1mm(9.449“x 12.681”)

public static final PrintAttributes.MediaSize JPN_KAKU2

日本Kaku2介质尺寸:240mm×332mm(9.449“×13.071”)

public static final PrintAttributes.MediaSize JPN_OUFUKU

日本Oufuku媒体尺寸:148mm x 200mm(5.827“x 7.874”)

public static final PrintAttributes.MediaSize JPN_YOU4

日文You4媒体大小:105mm x 235mm(4.134“x 9.252”)

public static final PrintAttributes.MediaSize NA_FOOLSCAP

北美Foolscap介质尺寸:8“x 13”(203mm x 330mm)

public static final PrintAttributes.MediaSize NA_GOVT_LETTER

北美政府 - Letter介质尺寸:8.0“x 10.5”(203mm x 267mm)

public static final PrintAttributes.MediaSize NA_INDEX_3X5

北美索引卡片3x5媒体大小:3“x 5”(76mm x 127mm)

public static final PrintAttributes.MediaSize NA_INDEX_4X6

北美索引卡片4x6媒介大小:4“x 6”(102mm x 152mm)

public static final PrintAttributes.MediaSize NA_INDEX_5X8

北美索引卡片5x8媒介大小:5“x 8”(127mm x 203mm)

public static final PrintAttributes.MediaSize NA_JUNIOR_LEGAL

北美初级合法媒体大小:8.0“x 5.0”(203mm×127mm)

public static final PrintAttributes.MediaSize NA_LEDGER

北美分类帐媒体大小:17“x 11”(432mm×279mm)

public static final PrintAttributes.MediaSize NA_LEGAL

北美法律媒体尺寸:8.5“x 14”(216毫米x 356毫米)

public static final PrintAttributes.MediaSize NA_LETTER

北美信纸尺寸:8.5“x 11”(279mm x 216mm)

public static final PrintAttributes.MediaSize NA_MONARCH

北美君主媒体大小:7.25“x 10.5”(184mm x 267mm)

public static final PrintAttributes.MediaSize NA_QUARTO

北美Quarto媒体尺寸:8“x 10”(203mm x 254mm)

public static final PrintAttributes.MediaSize NA_TABLOID

北美小报纸介质尺寸:11“x 17”(279mm×432mm)

public static final PrintAttributes.MediaSize OM_DAI_PA_KAI

中国戴霸凯媒体大小:275mm x 395mm(10.827“x 15.551”)

public static final PrintAttributes.MediaSize OM_JUURO_KU_KAI

中文Jurro Ku Kai媒体大小:198mm x 275mm(7.796“x 10.827”)

public static final PrintAttributes.MediaSize OM_PA_KAI

中国霸凯媒体大小:267mm x 389mm(10.512“x 15.315”)

public static final PrintAttributes.MediaSize PRC_1

中国PRC 1介质尺寸:102mm x 165mm(4.015“x 6.496”)

public static final PrintAttributes.MediaSize PRC_10

中国PRC 10媒体大小:324mm x 458mm(12.756“x 18.032”)

public static final PrintAttributes.MediaSize PRC_16K

中国中国16k介质尺寸:146mm x 215mm(5.749“x 8.465”)

public static final PrintAttributes.MediaSize PRC_2

中国PRC 2介质尺寸:102mm x 176mm(4.015“x 6.929”)

public static final PrintAttributes.MediaSize PRC_3

中国PRC 3介质尺寸:125mm x 176mm(4.921“x 6.929”)

public static final PrintAttributes.MediaSize PRC_4

中国PRC 4媒体大小:110mm x 208mm(4.330“x 8.189”)

public static final PrintAttributes.MediaSize PRC_5

中国PRC 5介质尺寸:110mm x 220mm(4.330“x 8.661”)

public static final PrintAttributes.MediaSize PRC_6

中国PRC 6介质尺寸:120mm x 320mm(4.724“x 12.599”)

public static final PrintAttributes.MediaSize PRC_7

中国PRC 7介质尺寸:160mm x 230mm(6.299“x 9.055”)

public static final PrintAttributes.MediaSize PRC_8

中国PRC 8媒体大小:120mm x 309mm(4.724“x 12.165”)

public static final PrintAttributes.MediaSize PRC_9

中国PRC 9媒体大小:229mm x 324mm(9.016“x 12.756”)

public static final PrintAttributes.MediaSize ROC_16K

中国ROC 16K介质尺寸:195mm x 270mm(7.677“x 10.629”)

public static final PrintAttributes.MediaSize ROC_8K

中国ROC 8K介质尺寸:270mm x 390mm(10.629“x 15.3543”)

public static final PrintAttributes.MediaSize UNKNOWN_LANDSCAPE

横向模式下的未知媒体大小。

public static final PrintAttributes.MediaSize UNKNOWN_PORTRAIT

未知的纵向模式下的媒体尺寸。

Public constructors

PrintAttributes.MediaSize(String id, String label, int widthMils, int heightMils)

创建一个新的实例。

Public methods

PrintAttributes.MediaSize asLandscape()

以横向方向返回新的媒体大小实例,即高度为较小维度。

PrintAttributes.MediaSize asPortrait()

以纵向方向返回新的媒体大小实例,即高度为较大的维度。

boolean equals(Object obj)

指示其他某个对象是否“等于”这一个。

int getHeightMils()

以千分之一(千分之一英寸)获取媒体高度。

String getId()

获取唯一的媒体大小ID。

String getLabel(PackageManager packageManager)

获取人类可读的媒体大小标签。

int getWidthMils()

获取媒体宽度(千分之一英寸)。

int hashCode()

返回对象的哈希码值。

boolean isPortrait()

获取此媒体大小是否为纵向,即高度大于或等于宽度。

String toString()

返回对象的字符串表示形式。

Inherited methods

From class java.lang.Object

Fields

ISO_A0

Added in API level 19
PrintAttributes.MediaSize ISO_A0

ISO A0介质尺寸:841mm x 1189mm(33.11“x 46.81”)

ISO_A1

Added in API level 19
PrintAttributes.MediaSize ISO_A1

ISO A1介质尺寸:594mm x 841mm(23.39“x 33.11”)

ISO_A10

Added in API level 19
PrintAttributes.MediaSize ISO_A10

ISO A10介质尺寸:26mm x 37mm(1.02“x 1.46”)

ISO_A2

Added in API level 19
PrintAttributes.MediaSize ISO_A2

ISO A2介质尺寸:420mm x 594mm(16.54“x 23.39”)

ISO_A3

Added in API level 19
PrintAttributes.MediaSize ISO_A3

ISO A3介质尺寸:297mm x 420mm(11.69“x 16.54”)

ISO_A4

Added in API level 19
PrintAttributes.MediaSize ISO_A4

ISO A4介质尺寸:210mm x 297mm(8.27“x 11.69”)

ISO_A5

Added in API level 19
PrintAttributes.MediaSize ISO_A5

ISO A5介质尺寸:148mm x 210mm(5.83“x 8.27”)

ISO_A6

Added in API level 19
PrintAttributes.MediaSize ISO_A6

ISO A6介质尺寸:105mm x 148mm(4.13“x 5.83”)

ISO_A7

Added in API level 19
PrintAttributes.MediaSize ISO_A7

ISO A7介质尺寸:74mm x 105mm(2.91“x 4.13”)

ISO_A8

Added in API level 19
PrintAttributes.MediaSize ISO_A8

ISO A8介质尺寸:52mm x 74mm(2.05“x 2.91”)

ISO_A9

Added in API level 19
PrintAttributes.MediaSize ISO_A9

ISO A9介质尺寸:37mm x 52mm(1.46“x 2.05”)

ISO_B0

Added in API level 19
PrintAttributes.MediaSize ISO_B0

ISO B0介质尺寸:1000mm x 1414mm(39.37“x 55.67”)

ISO_B1

Added in API level 19
PrintAttributes.MediaSize ISO_B1

ISO B1介质尺寸:707mm x 1000mm(27.83“x 39.37”)

ISO_B10

Added in API level 19
PrintAttributes.MediaSize ISO_B10

ISO B10介质尺寸:31mm x 44mm(1.22“x 1.73”)

ISO_B2

Added in API level 19
PrintAttributes.MediaSize ISO_B2

ISO B2介质尺寸:500mm x 707mm(19.69“x 27.83”)

ISO_B3

Added in API level 19
PrintAttributes.MediaSize ISO_B3

ISO B3介质尺寸:353mm x 500mm(13.90“x 19.69”)

ISO_B4

Added in API level 19
PrintAttributes.MediaSize ISO_B4

ISO B4介质尺寸:250mm x 353mm(9.84“x 13.90”)

ISO_B5

Added in API level 19
PrintAttributes.MediaSize ISO_B5

ISO B5介质尺寸:176毫米x 250毫米(6.93英寸x 9.84英寸)

ISO_B6

Added in API level 19
PrintAttributes.MediaSize ISO_B6

ISO B6介质尺寸:125mm x 176mm(4.92“x 6.93”)

ISO_B7

Added in API level 19
PrintAttributes.MediaSize ISO_B7

ISO B7介质尺寸:88mm x 125mm(3.46“x 4.92”)

ISO_B8

Added in API level 19
PrintAttributes.MediaSize ISO_B8

ISO B8介质尺寸:62毫米x 88毫米(2.44英寸x 3.46英寸)

ISO_B9

Added in API level 19
PrintAttributes.MediaSize ISO_B9

ISO B9介质尺寸:44mm x 62mm(1.73“x 2.44”)

ISO_C0

Added in API level 19
PrintAttributes.MediaSize ISO_C0

ISO C0介质尺寸:917mm x 1297mm(36.10“x 51.06”)

ISO_C1

Added in API level 19
PrintAttributes.MediaSize ISO_C1

ISO C1介质尺寸:648mm x 917mm(25.51“x 36.10”)

ISO_C10

Added in API level 19
PrintAttributes.MediaSize ISO_C10

ISO C10介质尺寸:28mm x 40mm(1.10“x 1.57”)

ISO_C2

Added in API level 19
PrintAttributes.MediaSize ISO_C2

ISO C2介质尺寸:458mm x 648mm(18.03“x 25.51”)

ISO_C3

Added in API level 19
PrintAttributes.MediaSize ISO_C3

ISO C3介质尺寸:324mm x 458mm(12.76“x 18.03”)

ISO_C4

Added in API level 19
PrintAttributes.MediaSize ISO_C4

ISO C4介质尺寸:229mm x 324mm(9.02“x 12.76”)

ISO_C5

Added in API level 19
PrintAttributes.MediaSize ISO_C5

ISO C5介质尺寸:162mm x 229mm(6.38“x 9.02”)

ISO_C6

Added in API level 19
PrintAttributes.MediaSize ISO_C6

ISO C6介质尺寸:114mm x 162mm(4.49“x 6.38”)

ISO_C7

Added in API level 19
PrintAttributes.MediaSize ISO_C7

ISO C7介质尺寸:81mm x 114mm(3.19“x 4.49”)

ISO_C8

Added in API level 19
PrintAttributes.MediaSize ISO_C8

ISO C8介质尺寸:57mm x 81mm(2.24“x 3.19”)

ISO_C9

Added in API level 19
PrintAttributes.MediaSize ISO_C9

ISO C9介质尺寸:40mm x 57mm(1.57“x 2.24”)

JIS_B0

Added in API level 19
PrintAttributes.MediaSize JIS_B0

日本JIS B0介质尺寸:1030mm×1456mm(40.551“×57.323”)

JIS_B1

Added in API level 19
PrintAttributes.MediaSize JIS_B1

日本JIS B1介质尺寸:728mm×1030mm(28.661“×40.551”)

JIS_B10

Added in API level 19
PrintAttributes.MediaSize JIS_B10

日本JIS B10介质尺寸:32mm x 45mm(1.259“x 1.772”)

JIS_B2

Added in API level 19
PrintAttributes.MediaSize JIS_B2

日本JIS B2介质尺寸:515mm x 728mm(20.276“x 28.661”)

JIS_B3

Added in API level 19
PrintAttributes.MediaSize JIS_B3

日本JIS B3介质尺寸:364mm×515mm(14.331“×20.276”)

JIS_B4

Added in API level 19
PrintAttributes.MediaSize JIS_B4

日本JIS B4介质尺寸:257mm×364mm(10.118“×14.331”)

JIS_B5

Added in API level 19
PrintAttributes.MediaSize JIS_B5

日本JIS B5介质尺寸:182mm×257mm(7.165“×10.118”)

JIS_B6

Added in API level 19
PrintAttributes.MediaSize JIS_B6

日本JIS B6介质尺寸:128mm x 182mm(5.049“x 7.165”)

JIS_B7

Added in API level 19
PrintAttributes.MediaSize JIS_B7

日本JIS B7介质尺寸:91mm x 128mm(3.583“x 5.049”)

JIS_B8

Added in API level 19
PrintAttributes.MediaSize JIS_B8

日本JIS B8介质尺寸:64mm×91mm(2.52“×3.583”)

JIS_B9

Added in API level 19
PrintAttributes.MediaSize JIS_B9

日本JIS B9介质尺寸:45mm×64mm(1.772“×2.52”)

JIS_EXEC

Added in API level 19
PrintAttributes.MediaSize JIS_EXEC

日本JIS Exec介质尺寸:216mm x 330mm(8.504“x 12.992”)

JPN_CHOU2

Added in API level 19
PrintAttributes.MediaSize JPN_CHOU2

日本Chou2媒体尺寸:111.1mm x 146mm(4.374“x 5.748”)

JPN_CHOU3

Added in API level 19
PrintAttributes.MediaSize JPN_CHOU3

日本Chou3媒体大小:120mm x 235mm(4.724“x 9.252”)

JPN_CHOU4

Added in API level 19
PrintAttributes.MediaSize JPN_CHOU4

日本Chou4媒体尺寸:90mm x 205mm(3.543“x 8.071”)

JPN_HAGAKI

Added in API level 19
PrintAttributes.MediaSize JPN_HAGAKI

日本Hagaki媒体大小:100mm x 148mm(3.937“x 5.827”)

JPN_KAHU

Added in API level 19
PrintAttributes.MediaSize JPN_KAHU

日本Kahu媒体大小:240mm x 322.1mm(9.449“x 12.681”)

JPN_KAKU2

Added in API level 19
PrintAttributes.MediaSize JPN_KAKU2

日本Kaku2介质尺寸:240mm×332mm(9.449“×13.071”)

JPN_OUFUKU

Added in API level 19
PrintAttributes.MediaSize JPN_OUFUKU

日本Oufuku媒体尺寸:148mm x 200mm(5.827“x 7.874”)

JPN_YOU4

Added in API level 19
PrintAttributes.MediaSize JPN_YOU4

日文You4媒体大小:105mm x 235mm(4.134“x 9.252”)

NA_FOOLSCAP

Added in API level 19
PrintAttributes.MediaSize NA_FOOLSCAP

北美Foolscap介质尺寸:8“x 13”(203mm x 330mm)

NA_GOVT_LETTER

Added in API level 19
PrintAttributes.MediaSize NA_GOVT_LETTER

北美政府 - Letter介质尺寸:8.0“x 10.5”(203mm x 267mm)

NA_INDEX_3X5

Added in API level 19
PrintAttributes.MediaSize NA_INDEX_3X5

北美索引卡片3x5媒体大小:3“x 5”(76mm x 127mm)

NA_INDEX_4X6

Added in API level 19
PrintAttributes.MediaSize NA_INDEX_4X6

北美索引卡片4x6媒介大小:4“x 6”(102mm x 152mm)

NA_INDEX_5X8

Added in API level 19
PrintAttributes.MediaSize NA_INDEX_5X8

北美索引卡片5x8媒介大小:5“x 8”(127mm x 203mm)

NA_JUNIOR_LEGAL

Added in API level 19
PrintAttributes.MediaSize NA_JUNIOR_LEGAL

北美初级合法媒体大小:8.0“x 5.0”(203mm×127mm)

NA_LEDGER

Added in API level 19
PrintAttributes.MediaSize NA_LEDGER

北美分类帐媒体大小:17“x 11”(432mm×279mm)

NA_LEGAL

Added in API level 19
PrintAttributes.MediaSize NA_LEGAL

北美法律媒体尺寸:8.5“x 14”(216毫米x 356毫米)

NA_LETTER

Added in API level 19
PrintAttributes.MediaSize NA_LETTER

北美信纸尺寸:8.5“x 11”(279mm x 216mm)

NA_MONARCH

Added in API level 19
PrintAttributes.MediaSize NA_MONARCH

北美君主媒体大小:7.25“x 10.5”(184mm x 267mm)

NA_QUARTO

Added in API level 19
PrintAttributes.MediaSize NA_QUARTO

北美Quarto媒体尺寸:8“x 10”(203mm x 254mm)

NA_TABLOID

Added in API level 19
PrintAttributes.MediaSize NA_TABLOID

北美小报纸介质尺寸:11“x 17”(279mm×432mm)

OM_DAI_PA_KAI

Added in API level 19
PrintAttributes.MediaSize OM_DAI_PA_KAI

中国戴霸凯媒体大小:275mm x 395mm(10.827“x 15.551”)

OM_JUURO_KU_KAI

Added in API level 19
PrintAttributes.MediaSize OM_JUURO_KU_KAI

中文Jurro Ku Kai媒体大小:198mm x 275mm(7.796“x 10.827”)

OM_PA_KAI

Added in API level 19
PrintAttributes.MediaSize OM_PA_KAI

中国霸凯媒体大小:267mm x 389mm(10.512“x 15.315”)

PRC_1

Added in API level 19
PrintAttributes.MediaSize PRC_1

中国PRC 1介质尺寸:102mm x 165mm(4.015“x 6.496”)

PRC_10

Added in API level 19
PrintAttributes.MediaSize PRC_10

中国PRC 10媒体大小:324mm x 458mm(12.756“x 18.032”)

PRC_16K

Added in API level 19
PrintAttributes.MediaSize PRC_16K

中国中国16k介质尺寸:146mm x 215mm(5.749“x 8.465”)

PRC_2

Added in API level 19
PrintAttributes.MediaSize PRC_2

中国PRC 2介质尺寸:102mm x 176mm(4.015“x 6.929”)

PRC_3

Added in API level 19
PrintAttributes.MediaSize PRC_3

中国PRC 3介质尺寸:125mm x 176mm(4.921“x 6.929”)

PRC_4

Added in API level 19
PrintAttributes.MediaSize PRC_4

中国PRC 4媒体大小:110mm x 208mm(4.330“x 8.189”)

PRC_5

Added in API level 19
PrintAttributes.MediaSize PRC_5

中国PRC 5介质尺寸:110mm x 220mm(4.330“x 8.661”)

PRC_6

Added in API level 19
PrintAttributes.MediaSize PRC_6

中国PRC 6介质尺寸:120mm x 320mm(4.724“x 12.599”)

PRC_7

Added in API level 19
PrintAttributes.MediaSize PRC_7

中国PRC 7介质尺寸:160mm x 230mm(6.299“x 9.055”)

PRC_8

Added in API level 19
PrintAttributes.MediaSize PRC_8

中国PRC 8媒体大小:120mm x 309mm(4.724“x 12.165”)

PRC_9

Added in API level 19
PrintAttributes.MediaSize PRC_9

中国PRC 9媒体大小:229mm x 324mm(9.016“x 12.756”)

ROC_16K

Added in API level 19
PrintAttributes.MediaSize ROC_16K

中国ROC 16K介质尺寸:195mm x 270mm(7.677“x 10.629”)

ROC_8K

Added in API level 19
PrintAttributes.MediaSize ROC_8K

中国ROC 8K介质尺寸:270mm x 390mm(10.629“x 15.3543”)

UNKNOWN_LANDSCAPE

Added in API level 19
PrintAttributes.MediaSize UNKNOWN_LANDSCAPE

横向模式下的未知媒体大小。

注意:这是用于指定没有介质尺寸的方向。 您不应该使用此实例报告的维度。

UNKNOWN_PORTRAIT

Added in API level 19
PrintAttributes.MediaSize UNKNOWN_PORTRAIT

未知的纵向模式下的媒体尺寸。

注意:这是用于指定没有介质尺寸的方向。 您不应该使用此实例报告的维度。

Public constructors

PrintAttributes.MediaSize

Added in API level 19
PrintAttributes.MediaSize (String id, 
                String label, 
                int widthMils, 
                int heightMils)

创建一个新的实例。

Parameters
id String: The unique media size id. It is unique amongst other media sizes supported by the printer.
label String: The localized human readable label.
widthMils int: The width in mils (thousandths of an inch).
heightMils int: The height in mils (thousandths of an inch).
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

Added in API level 19
PrintAttributes.MediaSize asLandscape ()

以横向方向返回新的媒体大小实例,即高度为较小维度。

Returns
PrintAttributes.MediaSize New instance in landscape orientation if this one is in portrait, otherwise this instance.

asPortrait

Added in API level 19
PrintAttributes.MediaSize asPortrait ()

以纵向方向返回新的媒体大小实例,即高度为较大的维度。

Returns
PrintAttributes.MediaSize New instance in landscape orientation if this one is in landscape, otherwise this instance.

equals

Added in API level 19
boolean equals (Object obj)

指示其他某个对象是否“等于”这一个。

equals方法在非空对象引用上实现等价关系:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

Objectequals方法实现了对象上最可能的等价关系; 也就是说,对于任何非空参考值xy ,当且仅当xy引用同一对象( x == y的值为true )时,此方法返回true

请注意,无论何时覆盖此方法,通常都需要覆盖 hashCode方法,以便维护 hashCode方法的常规协定,该方法声明等同对象必须具有相同的哈希代码。

Parameters
obj Object: the reference object with which to compare.
Returns
boolean true if this object is the same as the obj argument; false otherwise.

getHeightMils

Added in API level 19
int getHeightMils ()

以千分之一(千分之一英寸)获取媒体高度。

Returns
int The media height.

getId

Added in API level 19
String getId ()

获取唯一的媒体大小ID。 它在打印机支持的其他介质尺寸中是唯一的。

此ID由生成媒体大小实例的客户端定义,不应由其他方解释。

Returns
String The unique media size id.

getLabel

Added in API level 19
String getLabel (PackageManager packageManager)

获取人类可读的媒体大小标签。

Parameters
packageManager PackageManager: The package manager for loading the label.
Returns
String The human readable label.

getWidthMils

Added in API level 19
int getWidthMils ()

获取媒体宽度(千分之一英寸)。

Returns
int The media width.

hashCode

Added in API level 19
int hashCode ()

返回对象的哈希码值。 为了散列表的好处而支持该方法,例如由HashMap提供的HashMap

hashCode的总合同是:

  • 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 in equals 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(Object) method, then calling the hashCode 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(java.lang.Object) method, then calling the hashCode 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.

尽可能合理实用,类Object定义的hashCode方法确实为不同的对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java TM编程语言不需要此实现技术。)

Returns
int a hash code value for this object.

isPortrait

Added in API level 19
boolean isPortrait ()

获取此媒体大小是否为纵向,即高度大于或等于宽度。

Returns
boolean True if the media size is in portrait, false if it is in landscape.

toString

Added in API level 19
String toString ()

返回对象的字符串表示形式。 通常, toString方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。

ObjecttoString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”和对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

Hooray!