APIdia Launch Partner
Top Description Fields Constructors Methods
javax.print.attribute.standard

public final Class PrinterResolution

extends ResolutionSyntax
implements DocAttribute, PrintRequestAttribute, PrintJobAttribute
Class Inheritance
All Implemented Interfaces
javax.print.attribute.PrintJobAttribute, javax.print.attribute.Attribute, java.io.Serializable, javax.print.attribute.PrintRequestAttribute, javax.print.attribute.DocAttribute
Imports
java.io.Serial, javax.print.attribute.Attribute, .DocAttribute, .PrintJobAttribute, .PrintRequestAttribute, .ResolutionSyntax

Class PrinterResolution is a printing attribute class that specifies an exact resolution supported by a printer or to be used for a print job. This attribute assumes that printers have a small set of device resolutions at which they can operate rather than a continuum.

PrinterResolution is used in multiple ways:

  1. When a client searches looking for a printer that supports the client's desired resolution exactly (no more, no less), the client specifies an instance of class PrinterResolution indicating the exact resolution the client wants. Only printers supporting that exact resolution will match the search.
  2. When a client needs to print a job using the client's desired resolution exactly (no more, no less), the client specifies an instance of class PrinterResolution as an attribute of the Print Job. This will fail if the Print Job doesn't support that exact resolution, and Fidelity is set to true.
If a client wants to locate a printer supporting a resolution greater than some required minimum, then it may be necessary to exclude this attribute from a lookup request and to directly query the set of supported resolutions, and specify the one that most closely meets the client's requirements. In some cases this may be more simply achieved by specifying a PrintQuality attribute which often controls resolution.

IPP Compatibility: The information needed to construct an IPP "printer-resolution" attribute can be obtained by calling methods on the PrinterResolution object. The category name returned by getName() gives the IPP attribute name.

Authors
David Mendenhall, Alan Kaminsky

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Hides javax.print.attribute.ResolutionSyntax.serialVersionUID.

Use serialVersionUID from JDK 1.4 for interoperability.
Inherited from javax.print.attribute.ResolutionSyntax:
DPCMDPI

Constructor Summary

AccessConstructor and Description
public
PrinterResolution(int
cross feed direction resolution
crossFeedResolution
,
int
feed direction resolution
feedResolution
,
int
unit conversion factor, e.g. ResolutionSyntax.DPI or ResolutionSyntax.DPCM
units
)

Construct a new printer resolution attribute from the given items.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if object is equivalent to this printer resolution attribute, false otherwise
equals
(Object
Object to compare to
object
)

Overrides javax.print.attribute.ResolutionSyntax.equals.

Returns whether this printer resolution attribute is equivalent to the passed in object.

public final Class<? extends Attribute>

Returns:

printing attribute class (category), an instance of class java.lang.Class
getCategory
()

Implements javax.print.attribute.Attribute.getCategory.

Get the printing attribute class which is to be used as the "category" for this printing attribute value.

public final String

Returns:

attribute category name
getName
()

Implements javax.print.attribute.Attribute.getName.

Get the name of the category of which this attribute value is an instance.

Inherited from javax.print.attribute.ResolutionSyntax:
getCrossFeedResolutiongetCrossFeedResolutionDphigetFeedResolutiongetFeedResolutionDphigetResolutionhashCodelessThanOrEqualstoStringtoString

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.print.attribute.ResolutionSyntax.serialVersionUID.

Use serialVersionUID from JDK 1.4 for interoperability.

Annotations
@Serial

Constructor Detail

PrinterResolutionback to summary
public PrinterResolution(int crossFeedResolution, int feedResolution, int units)

Construct a new printer resolution attribute from the given items.

Parameters
crossFeedResolution:int

cross feed direction resolution

feedResolution:int

feed direction resolution

units:int

unit conversion factor, e.g. ResolutionSyntax.DPI or ResolutionSyntax.DPCM

Exceptions
IllegalArgumentException:
if crossFeedResolution < 1 or feedResolution < 1 or units < 1

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides javax.print.attribute.ResolutionSyntax.equals.

Returns whether this printer resolution attribute is equivalent to the passed in object. To be equivalent, all of the following conditions must be true:

  1. object is not null.
  2. object is an instance of class PrinterResolution.
  3. This attribute's cross feed direction resolution is equal to object's cross feed direction resolution.
  4. This attribute's feed direction resolution is equal to object's feed direction resolution.
Parameters
object:Object

Object to compare to

Returns:boolean

true if object is equivalent to this printer resolution attribute, false otherwise

Annotations
@Override
getCategoryback to summary
public final Class<? extends Attribute> getCategory()

Implements javax.print.attribute.Attribute.getCategory.

Get the printing attribute class which is to be used as the "category" for this printing attribute value.

For class PrinterResolution, the category is class PrinterResolution itself.

Returns:Class<? extends Attribute>

printing attribute class (category), an instance of class java.lang.Class

Annotations
@Override
getNameback to summary
public final String getName()

Implements javax.print.attribute.Attribute.getName.

Get the name of the category of which this attribute value is an instance.

For class PrinterResolution, the category name is "printer-resolution".

Returns:String

attribute category name

Annotations
@Override