[ic] Dymo and Brother Label Printer Examples - Windows
paul at gishnetwork.com
Mon Apr 3 12:22:37 EDT 2006
Hello List, for a few years we have been using a Dymo 330/400 to print
various labels from within IC. Recently I had a client using a Brother, so I
took some SDK examples and produced the sample below. Both these example can
basically be dropped right in Admin (Similar to Jason's example) and work on
Jason Kohles How to:
Note: You might want to change the regexes to be xhtml compliant, or it will
miss some <br />'s.
Brother QL-500 and similar:
1. Print button to make Label:
<A style="color:red;" HREF="#" onClick="Prints();">Label</a>
2. Set some scratch vars with shipping information:
[tmp bro_name][loop-param fname] [loop-param lname][/tmp]
[tmp bro_add][loop-param address1][/tmp]
[tmp bro_add2][loop-param address2][/tmp]
[tmp bro_csz][loop-param city], [loop-param state] [loop-param
[tmp bro_co][data table=country col=name key='[loop-param country]'
3. VBScript somewhere on the Page:
Set ObjDoc = CreateObject("BrssCom.Document")
bRet = ObjDoc.Open("__BROTHER_LABEL__")
If (bRet <> False) Then
ObjDoc.SetText 0, "[scratch bro_name]"
ObjDoc.SetText 1, "[scratch bro_add]"
[if scratch bro_add2]
ObjDoc.SetText 2, "[scratch bro_add2]"
ObjDoc.SetText 3, "[scratch bro_csz]"
ObjDoc.SetText 4, "[scratch bro_co]"
ObjDoc.SetText 2, "[scratch bro_csz]"
ObjDoc.SetText 3, "[scratch bro_co]"
ObjDoc.DoPrint 0, "0"
Set ObjDoc = Nothing
4. In Variables.txt add something like:
Note: Put website into Trusted Zones as per Jason Kohles example.
5. Just open up the Ptouch Label editor, make a label. From what I have
figured out is that the "SetText N" in the above Vbscript writes to the
label from the bottom up. So, make you label pretty, then be sure the bottom
most element is for example a large text box comprised of at least 5 text
lines. Leave them blank, but hit "enter" to make sure there are 5 text lines
in the text box. Save the label to the path to your label template
6. You have to install another application (besides the print driver of
course) called B-Pac Client. From what I can tell it does not continuously
run, so it does not bog down your PC.
With a little extra code you can let users use whichever printer they want
based on some field in your administrators table.
Maybe someone can improve upon these and repost in the future. Also,
Endicia.com has an API that should allow printing to a dymo, postage and all
- which is nice as the labels are not big, for those of us who have small
packages.... Doh! that didn't sound good...
More information about the interchange-users