您将什么字符发送到“通用/纯文本”打印机打印粗体和下划线字符?
我需要打印我正在进行的项目的报告。我已经打印它,但缺少一些格式(粗体、下划线),用于强调和区分某些区域。
打印机安装为“通用/仅文本”(客户端要求)。我已经在谷歌上搜索了一段时间,但还没有找到一种方法来发送正确的字符以使代码中的文本加粗和下划线。
如何通过代码在通用文本打印机中打印粗体和下划线字符?
I need to print a report for a project I'm working on. I'm already printing it, but some formatting is missing (bold, underline) that is used to emphasize and differentiate certain areas.
The printer is installed as "Generic/Text Only" (required by the client). I've been googling for a while now, and haven't found a way to send the right characters to make the text bolded and underlined from code.
How can I print bold and underline characters in a generic text only printer by code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
通常,纯文本打印机会通过将滑架移至左侧并叠印字符来响应 BS(退格)字符
chr(8)
。因此,要加粗单词,您可以发送字符:和下划线:
有时打印机可能会更好地响应 CR(回车符,
chr(13)
),这会将滑车一直移动到左侧,以便您可以在字符上留出空间并叠印:Often a plain text printer will respond to the BS (backspace) character,
chr(8)
by moving the carriage to the left and overprinting characters. So to bold a word, you could send the characters:and to underline:
Sometimes the printer might respond better to CR (carriage return,
chr(13)
) better, which moves the carriage all the way to the left so you can space over and overprint characters:好吧,如果它接受类似 Epson 的代码,则打印字节:
Well, if it accepts Epson-like codes then print the bytes:
您是否尝试过 ESC+E 开始粗体并 ESC+F 结束它?
Have you tried ESC+E to start bold and ESC+F to finish it?