delphi 调用打印软件代码


本文整理自网络,侵删。

 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.

相关阅读 >>

Delphi如何粘贴html格式文本到windows剪切板

Delphi idhttp1 xmlpost

Delphi动态创建控件的例子

Delphi winapi: windowfrompoint- 获取指定点所在窗口的句柄

Delphi 请求时间,为当前时间,数值为1970-01-01以来的毫秒数

Delphi 手机号码库段号地区查询

怀念一下这些经常不记得的Delphi代码

Delphi 调用exitwindows 关闭系统

Delphi通过代码实现模拟按键的函数

Delphi 从字符串中提取单词的函数

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...