LabelView/Codesoft 條碼打印范例 - 玄铁剑 - IT博客网
来源:互联网 发布:teleport ultra mac版 编辑:程序博客网 时间:2024/06/05 18:50
LabelView Sample:
private void Form1_Load(object sender, System.EventArgs e)
{
LabelApp=new LabelApplicationClass();
doc=(LabelView.LabelDocument)LabelApp.ActiveDocument();
doc.Open("c://worklog//label.lbl",true);
}
private void PrintLabel(string result)
{
try
{
LabelView.LabelField snLabel=(LabelView.LabelField)((LabelView.LabelFields)doc.LabelFields).Item("SN");
snLabel.Value=result;
doc.LabelSetup();
doc.PrintLabel(2,null,null,null,null,null,null);
}
catch(Exception err)
{
MessageBox.Show(err.ToString(),"提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
LabelApp.Quit();
LabelApp = null;
System.GC.Collect();
}
Zebra-ZPL Sample:
先用Bar-One做成Barcode文檔,再通過File-->Down formatter to print生成zpl文檔,通過編程對zpl文檔中特定數據進行替換,最後輸出到指定端口即可.
ofstream fout; //declare file-stream handle
fout.open("lpt1:", ios::out); //open out to lpt1:
fout<<"^XA"; // start ZPL command
fout<<"^FO11,19^A0N,17,16^FDYXX^FS"; // define the
locate of the printout and the size of the font
is 17 x 16
fout<<"^FO45,19^A0N,17,16^FDXXXXX^FS";
fout<<"^FO95,19^A0N,17,16^FDAA^FS";
fout<<"^FO121,19^A0N,17,16^FDB^FS";
fout<<"^FO11,40^A0N,13,12^FDMM/DD/YY^FS"; // define the
locate of the printout and the size of the font
is 13 x 12
fout<<"^FO81,40^A0N,13,12^FDC^FS";
fout<<"^FO103,40^A0N,13,12^FDD^FS";
fout<<"^FO11,59^A0N,13,12^FDPF^FS";
fout<<"^FO45,60^A0N,13,12^FDKF^FS";
fout<<"^FO73,60^A0N,13,12^FDDD^FS";
fout<<"^FO95,61^A0N,13,12^FDI^FS";
fout<<"^BY1,3,15^FO11,80^BCN,,Y,N^FD0705610065^FS"; // print barcode 128 with human readable
fout<<"^PQ1"; //print one label
fout<<"^XZ"; //sending end of zpl Print one
fout.close();
///////////////////////////////////////Codesoft Delphi
Var
BarApp,BarDoc:Variant;
Begin
BarApp := CreateOleObject('lppx.Application');
BarApp.Visible:=True;
BarDoc:=BarApp.ActiveDocument;
BarVars:=BarDoc.Variables;
BarDoc.Open('T018S1.Lab');
BarDoc.Variables.Item('Data1').Value:='ABCD';
BarDoc.Variables.Item('Data2').Value:='111';
BarDoc.Variables.Item('Data3').Value:='111ABCD';
Bardoc.Printlabel(1);
BarDoc.FormFeed;
Bardoc.Close;
BarApp.Quit;
End;
///////////////////////////////////////Codesoft C#
using LabelManager2;
ApplicationClass lbl = new ApplicationClass();
try
{
lbl.Documents.Open(@"D:/Temp/TEMP.Lab", false);
Document doc = lbl.ActiveDocument;
//foreach(...)
//{
doc.Variables.FormVariables.Item("Var0").Value = "12399999";
//doc.Variables.FreeVariables
//doc.Variables.Formulas
//doc.Variables.TableLookups
//doc.Variables.DatabaseVariables
//doc.Variables.Dates
//doc.Variables.Counters
doc.PrintDocument(1);
//}
doc.Close(false);
}
catch (Exception ex)
{
lbl.Quit();
}
SAMPLE CODESOFT 8 APPLICATIONS
Click a link below to download a sample ActiveX application:
- Borland C++
- C#
- Delphi
- Java
- JavaScript
- MS Access
- Visual Basic
- VB Script
- Visual C++
- MS InterDev
本文转自
http://www.cnitblog.com/MartinYao/archive/2007/09/11/33242.aspx
- LabelView/Codesoft 條碼打印范例 - 玄铁剑 - IT博客网
- LabelView/Codesoft 條碼打印范例
- C#調用CodeSoft打印條碼
- C#調用CodeSoft打印條碼
- Delphi 调用Codesoft打印条码
- Delphi结合LabelView进行条码打印
- Vb.net 调用Codesoft-LabelManager2 打印标签
- Vb.net 调用Codesoft-LabelManager2 打印标签
- Vb.net 调用Codesoft-LabelManager2 打印标签
- 使用vs2008结合codesoft来实现条形码的打印
- C#,VB.Net,VB6调用Codesoft打印标签
- C#调用CodeSoft控制两台打印机打印
- c#中如何用codesoft来打印标签开发分享
- 条码标签打印软件CodeSoft 6.0培训教程
- flex 打印范例
- C#在调用CodeSoft打印时修改了打印机的打印参数问题
- it 博客
- IT博客
- mysql-front 的注册key
- PHP 截取字符串专题
- C#中的委托和事件
- 日常用语-享受余暇时间
- 请高手帮忙!
- LabelView/Codesoft 條碼打印范例 - 玄铁剑 - IT博客网
- Oracle中,一个Delete操作的流程
- 提示:ActiveX 部件不能创建对象: Scripting.FileSystemObject
- PHP Socket 编程
- 我谈需求分析-001
- 交通银行总行各业务系统名称缩写对照表
- 网址
- [转载]我该使用何种语言(开发游戏)
- 在tomcat中部署appfusework1.8.2