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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -