by glitch (legacy member) on Mon Mar 31, 2008 10:27 am
You can find the print code in the VB6 sample project. See code below:
Printer.ScaleMode = vbTwips ' set the printer scalemode to Twips
'Coordinates for PaintPicture method must now be in Twips.
'1 inch has 1440 Twips.
XMargin = (Printer.Width - Printer.ScaleWidth) / 2
YMargin = (Printer.Height - Printer.ScaleHeight) / 2
X = 1 * 1440 ' X position in 1 Inch
Y = 1 * 1440 ' Y position in 1 Inch
X = X - XMargin ' adjust for margins
Y = Y - YMargin ' adjust for margins
'Print the barcode directly to the printer, start at position X,Y
Printer.Print "Morovia Bar Code Activex Sample"
Printer.Print "Printing the barcode at X= 1 Inch, Y= 1 Inch"
Printer.PaintPicture MrvBarcode1.Picture, X, Y
'Eject the page...
Printer.EndDoc