fiuhh, this case is one of the most annoying 'simple' approach
requirement is to send 'barcode' to printer directly, because often we using Image print (creating image on the fly then send it to barcode printer)..this one althought works but often the image become blur / discarded
so we need to 'communicate' to barcode printer using its 'language'
the 'language' depends on the printer itself..in my case, we using SATO barcode printer so the 'language' is
SBPL (visit the link for more info)
first we need to design the label
we can use SBPL and design it 'on the fly' make us a little bit crazy
or we can use SATO LABEL Gallery Free to do the job and generate SBPL equivalent for us so we can use it in our code
after we design it, we use "Print to file" method for the printer then print it so we can see what its send to the printer
the generated SBPL will contain 'unseen' character in visual studio IDE (i'm using VS 2010) so be careful with it, u must open it using 3rd party like Notepad++
just replace the 'dynamic' content (ie: productCode, productName, etc) then start printing it
caution:
1. if u need to add, just for readiness of the code then u need to replace it from the SBPL using notepad++ then paste it in code
before printing don't forget to Replace it again to so it can recognized using this method:
become
and using step 1. to replace it (tooks 2 days to realize it and search for the .NET equivalent way) :(
PS: stilll not sure how to display the Escape Character inside VS IDE ( maybe u'll see 'bad thing inside' :D )
until then
requirement is to send 'barcode' to printer directly, because often we using Image print (creating image on the fly then send it to barcode printer)..this one althought works but often the image become blur / discarded
so we need to 'communicate' to barcode printer using its 'language'
the 'language' depends on the printer itself..in my case, we using SATO barcode printer so the 'language' is
SBPL (visit the link for more info)
first we need to design the label
we can use SBPL and design it 'on the fly' make us a little bit crazy
or we can use SATO LABEL Gallery Free to do the job and generate SBPL equivalent for us so we can use it in our code
after we design it, we use "Print to file" method for the printer then print it so we can see what its send to the printer
the generated SBPL will contain 'unseen' character in visual studio IDE (i'm using VS 2010) so be careful with it, u must open it using 3rd party like Notepad++
just replace the 'dynamic' content (ie: productCode, productName, etc) then start printing it
caution:
1. if u need to add
before printing don't forget to Replace it again to so it can recognized using this method:
2. don't forget to copy it "as is" from generated File in, must include [STX][ETX] thing.Replace("
" , ((char)02).ToString()); .Replace("" , ((char)03).ToString()); .Replace("" , ((char)27).ToString());
become
and using step 1. to replace it (tooks 2 days to realize it and search for the .NET equivalent way) :(
PS: stilll not sure how to display the Escape Character inside VS IDE ( maybe u'll see 'bad thing inside' :D )
until then
Comments