Hi, I'm having an issue with printing barcodes to my label printer from Java.
After quite the laundry list of failed attempts, which included using fonts, I've resorted to manually drawing the bars to the Graphics object, which works... except for one thing...
The entire barcode prints correctly to PDFs, laser-, and ink-jet printers. That's great, except I need it to print to the label printer correctly, which it doesn't.
My barcode, when printed on the label printer, doesn't print the last (width-2) bar.
The odd things is, when I print the PDF to the label printer, that end bar DOES print.
Since the draw output is exactly the same independently of which printer the barcode prints to (the barcode drawing algorithm doesn't perform any checks on the Graphics object), I'm at a loss as to why this is happening.
The most common way to print barcodes is to use a barcode font. It's a lot less trouble than computing and rendering all the bars yourself.
When rendering anything near the edges of the print area, however, you are subject to clipping. Text renderers may clip entire letters, graphics renderers may just get stuff shaved off them. Your mileage may vary.
I think probably where you are running into grief has to do with the way that rendering and clipping are done. Printing is done within a 2-dimensional co-ordinate space whose actual dimensions are infinite (not really, but usually a lot bigger than the paper). The clipping mechanisms will then reduce the area that actually renders. There is, of course, the physical clipping that would occur when you attempt to print and your renderable region is physically larger than the page. Pixels fall off the edge, stuff fuzzes out, etc. You see stuff like this when you try and print a legal-sized document on a letter-sized page and it runs off the bottom.
Printers try and eliminate this action (partly because it's not good for the printer or the print quality) by defining a bounding box for rendering that's smaller than the physical page so that you only get the aforementioned overflow when the page in question isn't as big as the printer thinks it is. For some printers, there's physically no pixel-rendering elements outside a certain area, which itself is also a constraint.
Then there's the page size as defined by your app. Which is also applied. So the end result is the intersection rectangle of all of the preceding bounding boxes.
What I'm suspecting is that when you print a PDF, it's using a different bounding box for the PDF render area than your Java code is. You should be able to override the Java code's render area. If you are using brute-force print commands rather than the Java printing system, you may find that there's a hardware command you need to send to expand the print area.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.