• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help in figuring how to create labels for printing (barcodes, text, and colors)  RSS feed

 
Michael Peremsky
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am creating an application that needs to print out labels for file folders (like in a doctors office). The label need to have a barcode (may be optional), text (normal and rotated) and colored blocks. Similar to the image below.

The problem I am having is that I have no idea where to start to make this happen. I read some tutorials on the print services and was getting buried in technical details of selecting the printer. After selecting the printer, I need to create the print job. Now, this is where I am stuck. I have no idea how I am to make this "object" to be printed. Am I somehow supposed to make a BufferedImage and send that to the print job or do something else? I have never had to create an image or a print job in Java before and am stuck on this point. If creating an image is the best way to go, can anybody point me to a decent tutorial on how to create images?

I realize this is a bit open ended, but I need help getting pointed in the right direction. 3rd party software (that requires a license or paying for) is not an option. I did see the Barbeque code from apache to create barcodes, I saw that that can be sent to a PNG, GIF, etc. But, even if I could do that, it would not be part of the rest of the image/label that has text and other colored areas.

Any help getting pointed in the right direction would be greatly appreciated, I am on a bit of a time crunch.

 
Les Morgan
Rancher
Posts: 779
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first--you need to figure out how to create an Image, in this case a BufferedImage. Very easy, but then I've been doing it for a while. So what you want to do is to look up 2D Graphics and go through the tutorials.  Everything you need to know is there for creating the image for your project.

Once you get familiar with it, you'll see that Java really is a nice language to work with for graphics.
Les

[moderation comment] Huge quote has been removed as unnecessary makes thread longer
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's another tutorial you might find useful: Lesson: Printing.
 
Michael Peremsky
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys I will look into those 2 options. I really appreciate the quick response.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!