Prev: VB3 anyone...?
Next: rsidll32
From: mjimeno on 10 Jun 2005 19:37 I have another question for you mike: in this lines --------------------------- incheswide = 1.5 ' desired width of barcode incheswide = incheswide / 95 pixwide = Printer.ScaleX(incheswide, vbInches, vbPixels) PrintBarCode "639382000393", 1, 8.5, pixwide ---------------------------- Should the pixwide parameter be always a fixed size for the barcode? For example: If you send a 2 inches in the incheswide, should the barcode always be 2" wide no matter how many digits the barcode have? I'm not sure if I made something wrong, or it's right so, but it sometimes print a barcode 1.6" wide or 1.8" wide, or 2 or 2.2" wide. So, please let me know if that's normal. I guess it is as it finally print the lines the wide it can. Thanx, M
From: Gaga on 10 Jun 2005 22:40
"mjimeno" <miguelangeljimeno(a)hotmail.com> wrote in message news:600c11e1f9746ab3261b034d798d164d(a)localhost.talkaboutprogramming.com... >I have another question for you mike: in this lines > --------------------------- > incheswide = 1.5 ' desired width of barcode > incheswide = incheswide / 95 > pixwide = Printer.ScaleX(incheswide, vbInches, vbPixels) > PrintBarCode "639382000393", 1, 8.5, pixwide > ---------------------------- > Should the pixwide parameter be always a fixed size for the barcode? > For example: If you send a 2 inches in the incheswide, should the > barcode always be 2" wide no matter how many digits the barcode > have? I'm not sure if I made something wrong, or it's right so, but it > sometimes print a barcode 1.6" wide or 1.8" wide, or 2 or 2.2" wide. Actually the code that I posted was designed specifically to print UPC (Universal Product Code) barcodes. These UPC barcodes (apart from the special "zero suppressed" versions) always contain 12 digits, and each of those digits has a width of seven "thin lines". The group of twelve digits therefore is always the exact width of 12 x 7 = 84 "thin lines". In addition there are some start, middle and end codes that consist in total of 11 thin lines. The entire UPC barcode is therefore *always* 95 "thin lines" wide. If you want to print codes that contain a different number of digits them you will have to adjust the "95" in the above code accordingly. Also, the UPC barcode only contains digits (0 to 9). The code I posted is not designed to deal with other types of barcode (although it would of course be possible to modify it so as to accommodate such codes with a little extra work). Mike |