I am migrating my card design software from VB6 to VB.Net. To encode a magnetic stripe using VB6, I sent a delimited string to the printer during the print operation. This string was encoded to the appropriate magnetic stripe track. I cannot find how to do this in VB.Net, i.e. send a sentinel-delimited string during the print operation. I don't want to use Zebra SDK libraries if I can help it. Can anyone please assist?
Encoding magnetic stripe on Zebra printer using a sentinel-delimted string in .NET |
1 Replies
It's been a while since I did any vb6 but there's two methods that I remember without using the sdk.
1. Using the printdocument object and rely on the driver picking it out the commands embedded between the sentinals just as vb6, I haven't used this method for a long time and I can say for sure if it works on the current ZXP range.
PrintDocument Class (System.Drawing.Printing)
2. Send the raw binary commands to the printer using dll calls. I've used code similar to the link below but I've also used the .net 3.5 framework to achieve the same result but it isn't supported and no longer works with newer versions of windows.
https://support.microsoft.com/en-us/help/322090/how-to-send-raw-data-to…
Both of those methods are write only so depending on the printer I'd still suggest using the sdk as it will give you feed back on the success or fail of the encoding attempt. The zebra sdk's although not perfect are a lot nicer to work with than some other printer manufacturers.