I've been working on a label system in VB web app that prints to the Toshiba TEC Barcode printers for quite a while lately and it never seems to line up properly. I've tried changing the settings, and adjusting paper size, only re-calibrating the printer seems to help for a bit and then the alignment goes off again.
What I've been thinking of trying to do to overcome this issue is place a Button on the page that would allow the user to re-set/re-calibrate the printer. Figure this is better than them pulling on the label to line it back up again.
Here is the code used to print the label:
Public Sub SetPrintSettings(ByVal pd As PrintDocument, ByVal printer As String, ByVal printerselected As Integer)
Dim pSize As PaperSize
'set the printer
pd.PrinterSettings.PrinterName = printer
pd.DefaultPageSettings.Landscape = False
pSize = New PaperSize("USER", 400, 202)
pd.DefaultPageSettings.PaperSize = pSize
pd.DefaultPageSettings.Margins = New Margins(0, 0, 0, 0)
End Sub
I've gone through the PrinterSettings and DefaultPageSettings and there is nothing in there that will allow me to reset the printer.
Anyone have any ideas?