Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/03/2009, 01:41
Erickvk
 
Fecha de Ingreso: septiembre-2007
Mensajes: 268
Antigüedad: 16 años, 7 meses
Puntos: 8
Respuesta: Mandar al sistema imprimir

Si es multisistema.

Un ejemplo intentando imprimir el fichero "test.ps";

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) {
}
}