Esempio di stampa di file pdf.....modificalo a tuo piacere, il metodo per stampare é getPrintJob
bye!codice:JobAttributes ja = new JobAttributes(); ja.setPrinter("Acrobat Distiller"); ja.setDialog(JobAttributes.DialogType.NONE); PageAttributes pa = new PageAttributes(); pa.setOrigin(PageAttributes.OriginType.PRINTABLE); pa.setColor(PageAttributes.ColorType.COLOR); pa.setPrintQuality(PageAttributes.PrintQualityType.HIGH); PrintJob pj = getToolkit().getPrintJob(Fungi.fungi,"Fungi PDF",ja,pa); Graphics g = pj.getGraphics(); render(g); g.dispose(); pj.end();


Rispondi quotando