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实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改

Delphi xe6 取得app自己的版本号(横跨4个平台)

Delphi 检测一个网络连接是否有效带超时

Delphi应用synedit完美实现sql语法高亮

Delphi for 循环 to和downto的理解

Delphi xe5 android 调用手机震动(通过jobject测试是否支持震动)

Delphi建立文件的快捷方式

Delphi编写的一款锁屏小工具

Delphi -- gdi+ Delphi如何让 tgpimage 直接从流中加载图片

Delphi 调用外部 dll 中的函数(2. 晚绑定)

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



打赏

取消

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

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

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

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

评论

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