java print pdf with printdialog -
how can print pdf showing printdialog?
now printig code:
public static void print2(){ inputstream = null; try { printservice defaultprintservice = printservicelookup.lookupdefaultprintservice(); docprintjob printerjob = defaultprintservice.createprintjob(); file pdffile = new file(temppdf); = new bufferedinputstream(new fileinputstream(pdffile)); doc simpledoc = new simpledoc(is, docflavor.input_stream.autosense, null); printerjob.print(simpledoc, null); } catch (exception e) { e.printstacktrace(system.out); } }
but show print dialog:
public static void print2(){ inputstream = null; try { printerjob pj = printerjob.getprinterjob(); //pj set pdf file print ...? pj.printdialog(); } catch (exception e) { e.printstacktrace(system.out); } }
Comments
Post a Comment