惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
N
News and Events Feed by Topic
P
Privacy International News Feed
The Hacker News
The Hacker News
Schneier on Security
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
Security Latest
Security Latest
L
LINUX DO - 最新话题
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
博客园 - 【当耐特】
博客园 - Franky
P
Privacy & Cybersecurity Law Blog
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
月光博客
月光博客
D
Docker
Webroot Blog
Webroot Blog
The GitHub Blog
The GitHub Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
S
Security Affairs
Martin Fowler
Martin Fowler
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
B
Blog
L
Lohrmann on Cybersecurity
T
Threatpost
量子位
S
Schneier on Security
V
Visual Studio Blog
S
Securelist
T
The Exploit Database - CXSecurity.com
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
I
Intezer
Stack Overflow Blog
Stack Overflow Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 聂微东
小众软件
小众软件
罗磊的独立博客
雷峰网
雷峰网
Recorded Future
Recorded Future

博客园 - Tmouse

初中面谈招生网上招生报名系统 招生报名系统,考试报名系统,比赛报名系统,培训报名系统,登记系统,可自定义选项 多功能表单填报系统V1.2.1-适用于在线报名系统、调查、数据收集等 小学生打字练习软件_在线网上打字比赛软件系统 中小学微课资源管理系统的开发与利用 学校公文办公处理系统_基于ASP.NET和Swfupload、FlashPaper2.2、校讯通短信发送的开发 新课程网上选课系统V1.0—适用于中小学校本课程选课、选修课选课 学校公司电脑设备故障物业网上在线报修系统 在线网上打字系统_在线网上打字比赛软件_打字练习_中英文打字系统 中学小学学校学生德育量化管理系统_文明班评比量化系统_德育评价系统_德育量化考核系统_政教管理系统_政教考核系统 转:C# .NET中调用VB编写的DLL代码事例(我做了些修改) 转:c# 简单又好用的四舍五入方法 用什么Ajax才 旅行惊魂 学习div+css 初中变成了菜园子了! 在Flash中使影片剪辑等候一段时间播放 Windows2003 IIS6.0下rmvb等不能下载的解决办法 CSS使图像等比例缩放兼容IE6、IE7、FF
POS58票据热敏打印机,怎么用ESC/POS命令控制打印文字大小? - Tmouse - 博客园
Tmouse · 2010-04-14 · via 博客园 - Tmouse

使用的是POS58票据热敏打印机,怎么控制文字大小?
我知道ESC/POS指令,可不会用。
ASCII :ESC ! n
十进制 :27 33 n
十六进制:1B 21 n

在C#里用十进制,是不是(char)(27)+(char)(33)+(char)(n)就可以把文字放大一倍打印了?
主要是想放大文字打印。n不知道取多少? 是48吗?

比如要将"中国"这个字符串放大一倍打印,具体怎么写的?

____________________________________________________

经过多次尝试,终于搞懂了.

先用字符的形式发送命令:

send = "" + (char)(27) + (char)(64) + (char)(27) + (char)(33) + (char)(48);

            for (int i = 0; i < send.Length; i++)
            {
                buf[i] = (byte)send[i];
            }

            fs.Write(buf, 0, buf.Length);

 解释:  (char)(27) + (char)(64)是将打印机初始化, (char)(27) + (char)(33) + (char)(48); 是设置打印字符格式命令,最后的48可以为0,16,32,48

接着直接打印输出:

printLPT.PrintData("中国" );

欢迎有同类问题的朋友指教!

*************************************************************************************

更正:其实可以把控制命令字符和输出字符写在一起.不管用什么方式,如果是多条数据就要在一个输出程序里同时输出,而不要写成函数的形式来调用,那样是不会成功的.这是我经过一天一夜研究出来的结果,网上也能找到ESC/POS打印指令使用的程序,人家就是写在一起的,但没有控制字符大小的例子.我自作聪明的把它改成一个函数,费了一天一夜的功夫才发现走了弯路.不过也值得,终于弄懂了ESC/POS指令怎么用了.