aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Using the printer: generating data on-the-fly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Using the printer: generating data on-the-fly" Watch "Using the printer: generating data on-the-fly" New topic
Author

Using the printer: generating data on-the-fly

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

My program needs to send some data to the printer. The catch: the data to print is calculated dynamically, "on the fly" ; it's not taken from any static file (though I'm willing to generate a temporary file if necessary).

Furthermore, my printable data contains both *text and images* (with some layout , e.g: "logo image on the top, then some text, then logo image at the bottom").

Being new to java Printing, I'd appreciate any hints as to how to go about it.
What format would you use to describe text + images + layout ? It should be understandable by the Printer, but also easy to generate through java... postscript? PDF ? HTML ? ...

Thanks
H Lander
Greenhorn

Joined: Oct 23, 2005
Posts: 15
One way you can do it is to use HTML. You can load the HTML into a JEditorPane which you can display on the screen. This will give you the full power of HTML for laying out the material to be printed. That's the easy part.

The hard part is printing the JEditorPane. I've used a commercial package which does this, its called the "Java Print Dialog Framework". See their web page for details: Soft Frame Works
 
 
subject: Using the printer: generating data on-the-fly
 
Similar Threads
Putting variable text over a splash screen
Printing API Question
repainting problems...
CERTIFICATION LOGO
How to print barcode labels using barcode4j?