通过 C# 以(并行端口)点阵打印
出于项目的需要,我想在特定位置打印 LPT1,这将在点阵打印机中打印文档,我应该在它们应该去的地方打印值。我真的很讨厌回去,我不知道从哪里开始。互联网上没有关于使用 C# 在 LPT 端口进行打印的具体信息,特别是如何在打印时发送特定位置的值。有什么好的例子吗?这个的教程?将是一个救星。
For the needs of a project, i want to print over the LPT1 in specific locations, this will print a document in a dot matrix printer where i should print values in the places they should go. I really hate going back, and i don't have any idea where to start. Internet has no specific information about printing in LPT port with C# and especially how to send the values in specific locations while printing. Is there any good example? tutorial for this? would be a life savior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我可以建议一件事让您的生活更轻松,安装通用文本打印机驱动程序(这是标准配置)并将其设置为 LPT1 端口。然后,您只需打开“LPT1”并发送转义代码序列来指定字体类型(粗体/斜体)、强调、字体间距等。我不知道是否需要资源。但我想它会是这样的:
资源:
于 2017-07-12 编辑:更新了并行端口链接以使用 Wayback Archive Machine。
I could suggest one thing to make your life easier, install a generic text printer driver (this comes as standard) and set that to the LPT1 port. Then you can simply open 'LPT1' and send escape code sequences to specify font type (bold/italic), emphasized, font pitch etc. I don't know if the resources would be required. But I would imagine it would be something like this:
Resources:
Edited @ 2017-07-12: Updated the Parallel Port link to use the Wayback Archive Machine.
有问题的打印机没有 Windows 打印驱动程序吗?如果是这样,是否通过 LPT1 打印并不重要,它只是使用标准的打印内容。
类似的问题: C# 中的点阵打印?
Doesn't the printer in question have a windows print driver? If so, it doesn't matter that it is printing over LPT1 or not, it is just using the standard Print stuff.
Similar question: Dot Matrix printing in C#?
如果您的打印机具有适用于 Windows 的驱动程序,则您可以使用标准打印技术。请参阅 Petzold 的书用 C# 编程 Microsoft Windows 以获得很好的介绍。
If your printer has drivers for Windows, then you can use standard printing techniques. See Petzold's book Programming Microsoft Windows with C# for a good intro.
嘿,我在 2019 年刚买了一台点阵打印机,你仍然可以花 5 英镑购买色带。
无需驱动程序,您只需要一个并行端口,如果没有,您可以购买一张 PCI-e 卡。
Hey I just got a dot matrix printer in 2019 and you can still buy the ribbons for £5.
No drivers you just need a parallel port, you can get a PCI-e card if you don't have one.