当前位置:首页教育技巧word技巧word图形处理

word打印pos小票如何设置

减小字体 增大字体 2025-12-21 10:02:14


1.能用word打印小票吗

可以~安装1600K的专用控件。

装上第三方控件后你可以自行修改也可以用~

如下:

附例:Delphi

//生成打印数据文件 dirname+`prn.txt`

procedure TForm1.SaveTxt;

var F :Textfile;

begin

AssignFile(F,dirname+`prn.txt`);

try

ReWrite(F);

Writeln(F,`要打印的第一行`);

Writeln(F,`要打印的第二行`);

Writeln(F,`要打印的第三行`);

Writeln(F,`要打印的第四行`);

Writeln(F,`要打印的第五行`);

//。。

finally

Closefile(F);

end;

end;

/////////

---------------------------------------

//调用打印接口程序的方法

procedure TForm1.Printme;

var

sCommandLine: string;

bCreateProcess: boolean;

lpStartupInfo: TStartupInfo;

lpProcessInformation: TProcessInformation;

begin //命令行参数

sCommandLine :=dirname+`Printer.EXE `+dirname+`prn.txt *****`;

// 填入 StartupInfo 信息

FillChar(lpStartupInfo,Sizeof(TStartupInfo),#0);

lpStartupInfo.cb := Sizeof(TStartupInfo);

lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;

lpStartupInfo.wShowWindow := SW_NORMAL;

//启动进程(调用打印接口程序)

bCreateProcess := CreateProcess(nil,PChar(sCommandLine),nil,nil,True,

CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,nil,nil,lpStartupInfo,lpProcessInformation);

end;

-----------------------------------------

//!!!!!!!!!当然,还有一个更简单的方法可以生成txt文件,如下:

1.用一个ListBox1控件,其Visible属性设为False

ListBox1.Items.Clear;

ListBox1.Items.Add(`要打印的第一行`);

ListBox1.Items.Add(`要打印的第二行`);

//。.等等

ListBox1.Items.SaveToFile(dirname+`prn.txt`);

Printme;//调用套件,开始执行打印。。OK!!!!!!!!简单吧!!!!!!!!!

评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分)

【免责声明】本站信息来自网友投稿及网络整理,内容仅供参考,如果有错误请反馈给我们及时更正,对文中内容的真实性和完整性本站不提供任何保证,不承但任何责任。
版权所有:学窍知识网 Copyright © 2011-2026 www.at317.com All Rights Reserved .