Defining print request attributes
suggest changeA print request can carry attributes that describe the job:
- number of copies (1, 2, and so on)
- orientation (portrait or landscape)
- chromaticity (monochrome, color)
- quality (draft, normal, high)
- sides (one-sided, two-sided, and so on)
Before choosing one of them and which value each one will have, first we need to build a set of attributes:
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
Now we can add them. Some examples are:
pras.add(new Copies(5));
pras.add(MediaSize.ISO_A4);
pras.add(OrientationRequested.PORTRAIT);
pras.add(PrintQuality.NORMAL);
The pras object now can be sent to the print job request (see Creating a print job from a print service).
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents