DocumentPrintAttributeSet

Inheritance: java.lang.Object, javax.print.attribute.HashAttributeSet

public final class DocumentPrintAttributeSet extends HashAttributeSet

Represents helper class with user-friednly interface to with AttributeSet.

Constructors

ConstructorDescription
DocumentPrintAttributeSet(int copies)Initializes a new instance of DocumentPrintAttributeSet.
DocumentPrintAttributeSet(String printerName, int copies)Initializes a new instance of DocumentPrintAttributeSet.
DocumentPrintAttributeSet(String printerName)Initializes a new instance of DocumentPrintAttributeSet.
DocumentPrintAttributeSet()Initializes a new instance of DocumentPrintAttributeSet.

Methods

MethodDescription
getCopies()
getLandscape()
getPrinterName()
setCollate(boolean value)Sets a value indicating whether document is collated.
setCopies(int value)Sets the number of copies to be printed.
setDuplex(boolean value)Sets the printer setting for double-side printing.
setLandscape(boolean value)Sets the orientation of the page.
setPrintRange(int page)Sets the single page to be printed.
setPrintRange(int from, int to)Sets the page range to be printed.
setPrinterName(String printerName)The name of the printer to be used.
setPrinterName(String printerName, Locale locale)The name of the printer to be used.

DocumentPrintAttributeSet(int copies)

public DocumentPrintAttributeSet(int copies)

Initializes a new instance of DocumentPrintAttributeSet. By default all document’s pages are printed.

Parameters:

ParameterTypeDescription
copiesintThe number of document’s copies to be printed.

DocumentPrintAttributeSet(String printerName, int copies)

public DocumentPrintAttributeSet(String printerName, int copies)

Initializes a new instance of DocumentPrintAttributeSet. By default all document’s pages are printed.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.
copiesintThe number of document’s copies to be printed.

DocumentPrintAttributeSet(String printerName)

public DocumentPrintAttributeSet(String printerName)

Initializes a new instance of DocumentPrintAttributeSet. By default the only copy of every page.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.

DocumentPrintAttributeSet()

public DocumentPrintAttributeSet()

Initializes a new instance of DocumentPrintAttributeSet. By default the only copy of every page.

getCopies()

public int getCopies()

Returns: int

getLandscape()

public boolean getLandscape()

Returns: boolean

getPrinterName()

public String getPrinterName()

Returns: java.lang.String

setCollate(boolean value)

public void setCollate(boolean value)

Sets a value indicating whether document is collated.

Parameters:

ParameterTypeDescription
valuebooleantrue is equivalent to setting of SheetCollate.COLLATED false is equivalent to setting of SheetCollate.UNCOLLATED

setCopies(int value)

public void setCopies(int value)

Sets the number of copies to be printed.

Parameters:

ParameterTypeDescription
valueintThe number of copies to be printed.

setDuplex(boolean value)

public void setDuplex(boolean value)

Sets the printer setting for double-side printing.

Parameters:

ParameterTypeDescription
valuebooleantrue is equivalent to setting of Sides.DUPLEX false is equivalent to setting of Sides.ONE_SIDED

setLandscape(boolean value)

public void setLandscape(boolean value)

Sets the orientation of the page.

Parameters:

ParameterTypeDescription
valuebooleantrue is equivalent to setting of OrientationRequested.LANDSCAPE false is equivalent to setting of OrientationRequested.PORTRAIT

setPrintRange(int page)

public void setPrintRange(int page)

Sets the single page to be printed.

Parameters:

ParameterTypeDescription
pageintThe page to be printed.

setPrintRange(int from, int to)

public void setPrintRange(int from, int to)

Sets the page range to be printed.

Parameters:

ParameterTypeDescription
fromintThe first page.
tointThe last page.

setPrinterName(String printerName)

public void setPrinterName(String printerName)

The name of the printer to be used.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.

setPrinterName(String printerName, Locale locale)

public void setPrinterName(String printerName, Locale locale)

The name of the printer to be used.

Parameters:

ParameterTypeDescription
printerNamejava.lang.StringThe name of the printer.
localejava.util.LocaleprinterName’s locale.