RSS订阅 | 匿名投稿
您的位置:网站首页 > 打印 > 正文

delphi 调用打印软件代码

作者:admin 来源:未知 日期:2010/5/22 20:21:29 人气: 标签:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, OleServer, BarTender_TLB;

type
TForm1 = class(TForm)
btApp1: TBTApplication;
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
with btApp1.Formats.Open('c:\test.btw', True, '') do //打开标签文件
begin
SetNamedSubStringValue('BarCode1', pchar(edit4.Text)); //设置值
SetNamedSubStringValue('Text1', pchar(edit2.Text));
SetNamedSubStringValue('Text2', pchar(edit1.Text));
SetNamedSubStringValue('Text3', pchar(edit3.Text));
SetNamedSubStringValue('Text4', pchar(edit4.Text));
PrintOut(False, False); //打印
// Close(btDoNotSaveChanges); //关闭不保存
end;
//btApp1.Quit(btDoNotSaveChanges); //退出
END;

end.

读完这篇文章后,您心情如何?
0
0
0
0
0
0
0
0
本文网址: