|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Apr 2002
Città: Cagliari
Messaggi: 72
|
PrintRequestAttributeSet non stampa
Ciao a tutti,ho un problema utilizzando la classe PrintRequestAttributeSet ossia:
--------------------------- CODE ------------------ DocFlavor myFormat = DocFlavor.INPUT_STREAM.AUTOSENSE; Doc mydoc = new SimpleDoc(textStream,myFormat,null); PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); PrintService[] services = PrintServiceLookup.lookupPrintServices(myFormat, aset); if (services.length > 0) { DocPrintJob job = services[0].createPrintJob(); try { job.print(mydoc, aset); } catch (PrintException pe) {} } --------------------------- CODE ------------------ Questo funziona e mi stampa sul foglio ciò che passo come inputStream però non fa uscire il foglio dalla stampante, e devo pensarci io con il pulsante sulla stampante. Allora ho pensato di risolvere tramite gli attributi tipo MediaSize. Il problema è che appenaaggiungo un qualsiasi attributo, fosse anche Copies(1), il codice non trova nessuna stamante o per intenderci questa riga PrintService[] services = PrintServiceLookup.lookupPrintServices(myFormat, aset); mi da un services nullo. Ho provato aggiungendo qualsiasi attributo e non va. La stampante che ho è una Epson R265. Qualcuno ha avuto lo stesso problema o qualcuno ha idea di come far uscire comunque il foglio????? Grazie di tutto
__________________
Il successo è ottenere ciò che si vuole. La felicità è volere ciò che si ottiene |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:30.



















