Problemas con DocFlavor
Publicado por Mugutu (13 intervenciones) el 30/08/2007 17:52:53
Hola!
Estoy tratando de imprimir texto con éste código:
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = service.createPrintJob();
DocFlavor flavor = DocFlavor.STRING.TEXT_PLAIN;
Doc doc = new SimpleDoc(obtenerTexto().toString(), flavor, null);
PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet();
attrs.add(new Copies(1));
job.print(doc, attrs);
Pero me devuelve este error:
sun.print.PrintJobFlavorException: invalid flavor
Estoy tratando de imprimir texto con éste código:
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = service.createPrintJob();
DocFlavor flavor = DocFlavor.STRING.TEXT_PLAIN;
Doc doc = new SimpleDoc(obtenerTexto().toString(), flavor, null);
PrintRequestAttributeSet attrs = new HashPrintRequestAttributeSet();
attrs.add(new Copies(1));
job.print(doc, attrs);
Pero me devuelve este error:
sun.print.PrintJobFlavorException: invalid flavor
Valora esta pregunta


0