A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Java Print
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
posted
Mar 25, 2009 02:44:43
0
Hi
Currently am printing a document using below code. But this will print in default printer. But I need a printdialog before printing
Someone please assist me.
try { PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService(); DocPrintJob printerJob = defaultPrintService.createPrintJob(); File pdfFile = new File(arg); SimpleDoc simpleDoc = new SimpleDoc(pdfFile.toURL(), DocFlavor.URL.AUTOSENSE, null); printerJob.print(simpleDoc, null); } catch (java.lang.Exception e) { }
I dont want to override print() or to implement printable
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35224
7
posted
Mar 25, 2009 03:19:00
0
This may be helpful:
http://www.exampledepot.com/egs/javax.print/DiscoverAll.html
Android apps
–
ImageJ plugins
–
Java web charts
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Java Print
Similar Threads
Java Print Dialog
java printing - printing a pdf
Printing issue in Java 1.4 and Fine in Java 1.5
Java Cyrillic Characters
Printing Report in Struts2
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter