- All Superinterfaces:
- AttributeSet
- All Known Implementing Classes:
- HashPrintRequestAttributeSet
- See Also:
- Top Examples, Source Code,
addAll(AttributeSet)
, add(Attribute)
, PrintRequestAttribute
boolean add(Attribute attribute)
- See Also:
- NullPointerException,
PrintRequestAttribute
, ClassCastException, UnmodifiableSetException, AttributeSet
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[532]Print Service Example
By Anonymous on 2005/05/12 10:58:04 Rate
//Print Service Example
import javax.print.*;
DocFlavor df = DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII;
Doc myDoc = new SimpleDoc ( ts, myFormat, null ) ;
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet ( ) ;
pras.add ( MediaSize.ISO_A4 ) ;
PrintService [ ] services = PrintServiceLookup.lookupPrintServices ( myFormat, pras ) ;
DocPrintJob job = services [ 0 ] .createPrintJob ( ) ;
try {
job.print ( myDoc, pras ) ;
} catch ( PrintException pe ) {
// Handle exception
}
boolean addAll(AttributeSet attributes)
- See Also:
add(Attribute)
, NullPointerException, PrintRequestAttribute
, ClassCastException, UnmodifiableSetException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples