如何使用MS-DOS命令使用ESC / POS命令裁纸? [英] How to use MS-DOS Commands to cut paper using ESC/POS commands?

查看:152
本文介绍了如何使用MS-DOS命令使用ESC / POS命令裁纸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对从Windows(MS-Dos)打印文本文件有一个简单的要求。假设我的普通文本文件位于 C:\Temp文件夹中。另一方面,我有一台EPSON TM88V收据打印机。我可以在USB上连接的票据打印机上握手,并可以使用以下命令进行打印:

I have a simple requirement of printing text files from Windows (MS-Dos). Let's assume that my normal text file resides on "C:\Temp" folder. On the other hand, I have a EPSON TM88V receipt printer. I am able to shake hand with receipt printer connected on USB and able to print it with below command:

C:\Temp> 打印/ D:\ \WORKSTATION\EPSONTM-T88V C:\Temp\HelloWorld.txt

C:\Temp> PRINT /D:\WORKSTATION\EPSONTM-T88V C:\Temp\HelloWorld.txt

尽管正在打印;但这不是裁纸。我需要在文本文件中插入这些ESC / POS命令,并将其传递给打印机,以便在完成文本文件的打印后立即进行裁纸。

Though it's printing; but it's not cutting the paper. I need to insert those ESC/POS commands in my text file and pass it on to the printer so as to cut the paper as soon as it finishes printing my text file.

感谢您在这方面的帮助,因为我曾经去过
这样的网站 http://nicholas.piasecki.name/blog/wp-content/uploads/2009/12/ESC-POS-Command-Guide.pdf
http://www.delfi .com / SupportDL / Epson / Manuals / TM-T88IV / Programming%20manual%20APG_1005_receipt.pdf

Appreciate, you help in this regard as I had gone thru sites like "http://nicholas.piasecki.name/blog/wp-content/uploads/2009/12/ESC-POS-Command-Guide.pdf" "http://www.delfi.com/SupportDL/Epson/Manuals/TM-T88IV/Programming%20manual%20APG_1005_receipt.pdf"

但无法理解如何将其作为转义符传递

but unable to understand how to pass it as escape characters.

在上述链接中,他们提到使用 GS V m,但请注意。

In the above links, they mentioned to use "GS V m", but pls. help how to perform it thru DOS commands.

推荐答案

GS V m意味着您必须向打印机发送控制字符串包含以下十六进制值

"GS V m" means, you have to send a controlstring to the printer containing the following hexadecimal values

0x1D 0x56 <m>

使用哪个值代替您看到的第二个链接,第372ff页。 (也许您需要添加一个LF(0x10)来完成命令序列)

Which value to use instead of see your 2nd link, page 372ff. (maybe you need to add a LF (0x10) to complete the command sequence)

您可以将这些值放入文件(例如cutnow.bin)并将其发送到您的打印机
(打印/ D:yourprinter cutnow.bin)。

You can put those values into an file (e.g. cutnow.bin) and send it to your printer (print /D:yourprinter cutnow.bin).

如何生成此文件?

我不知道有任何简单的批量方法,我会为此使用Basic(任何其他编程语言都可以)。 (您只需要生成一次该文件)
也许有一个使用VBS的简单的单行解决方案,但是我不会说VBS。

I don't know of any simple way to do this in batch, I'd use Basic for that (any other programming language should do). (you need to generate this file only once) Maybe there is a simple one-line solution using VBS, but I don't speak VBS.

编辑:
对于Basic,它看起来像:
(请注意,有很多不同的基本方言,因此您的代码可能不同)

For Basic it would look like that: (note that there are many different basic-dialects, so your code may be different)

open cutnow.bin for write as #1:print #1,chr$(0x1D)+chr$(0x56)+chr$(41):close #1

请记住,您可能必须添加换行符(chr $(10))-抱歉,不记得了,三年前我做了那种事情……

Remember, that you MIGHT have to add a Linefeed (chr$(10)) - sorry, can't remember, I did that kind of stuff three decades ago...

最后一个字符(41)可能会有所不同-请看一下页面,我上面提到的

Also the last char (41) may vary - take a look at the page, I mentioned above

这篇关于如何使用MS-DOS命令使用ESC / POS命令裁纸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆