
22/06/2009, 03:21
|
 | | | Fecha de Ingreso: febrero-2007
Mensajes: 894
Antigüedad: 18 años, 1 mes Puntos: 10 | |
Respuesta: Problema al imprimir desde Java http://java.sun.com/j2se/1.4.2/docs/...ntService.html
Código:
DocFlavor flavor = DocFlavor.INPUT_STREAM.POSTSCRIPT;
PrintRequestAttributeSet aset = new HashPrintRequestHashAttributeSet();
aset.add(MediaSizeName.ISO_A4);
PrintService[] pservices =
PrintServiceLookup.lookupPrintServices(flavor, aset);
if (pservices.length > 0) {
DocPrintJob pj = pservices[0].createPrintJob();
// InputStreamDoc is an implementation of the Doc interface //
Doc doc = new InputStreamDoc("test.ps", flavor);
try {
pj.print(doc, aset);
} catch (PrintException e) {
}
}
La tercera linea parece que pone tamaño A4. |