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

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.

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

getCopies()

public int getCopies()

Returns: int

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

getPrinterName()

public String getPrinterName()

Returns: java.lang.String

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.

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.

getLandscape()

public boolean getLandscape()

Returns: boolean

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 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.

setPrintRange(int page)

public void setPrintRange(int page)

Sets the single page to be printed.

Parameters:

ParameterTypeDescription
pageintThe page to be printed.