Help printing a barcode. Looking for best practice
I want to print a barcode that is generated by our system. I have a coupl开发者_开发百科e of concerns though and would like some input on the right way to do this if my solution is not right.
I have a link that the user can click to print this barcode. Once clicked, I thought it would be nice to use javascript to immediately being printing. I have this wourking so far. The first problem that I see is that when I print, I get "Page 1" at the top right. This throws off the measurement on the label I am printing to. The label has a maximum width of 2.63".
The second issue that I can see is that I am using a screen resolution of 1680x1050 to develop this. I am wondering if a user has a lower screen resolution if this will affect the height and width of the barcode when printed. I'm certain that it will but an not sure how to overcome this.
Can someone offer a better solution or tell me how I can overcome these issues?
From my experience, barcodes are available as fonts. As long as you specify the font size in pixels it will be consistent.
You will likely need to experiment with a print.css file to get the results you desire.
I have seen a couple of websites that generate position-specific information like this for printing, and they have generated PDF files for users to print.
PDF reading software is ubiquitous and you can ensure that the printed document appears exactly how you wish.
精彩评论