Python 将标签发送到 Zebra IP 打印机 [英] Python send label to Zebra IP printer
问题描述
我有什么
- 打印机内部 IP
- 打印机上的 ZPL 代码
- 插入 ZPL 代码的参数
有没有办法定义标签并通过 Python 将其发送到打印机?我需要指定要在打印机上使用的标签类型,因为它可以存储多个 .zpl 标签代码.
有专门的图书馆吗?另外还有哪些基本的套接字函数可以帮助我入门
好吧,我不是python专家,但大致流程是:
打开一个到端口 9100 的 TCP 连接
将 ZPL 写入您的连接
关闭连接
您需要查看 ZPL 编程指南中的 ^DF 和 ^XF 命令以确保您正确使用模板,但这是一个非常简单的过程.
如果您担心打印机是否准备好打印,您可以查看 ~hs 命令以获取当前状态.
最后有一个 C# 和 Java SDK 可用于打印机,它具有帮助函数将存储在 Maps 中的变量推送到模板,但 JNI 调用可能比打开 TCP 连接更复杂......>
What I have
- Printer internal IP
- ZPL code on printer
- parameters to plug into ZPL code
Is there a way to define a label and send it to the printer via Python? I would need to specify which label type to use on the printer since it can have multiple .zpl label codes stored on it.
are there dedicated libraries? Otehrwise what are some basic socket functions to get me started
OK I am not a python expert here but the general process is:
Open a TCP connection to port 9100
Write ZPL to your connection
Close your connection
You will want to look at the ^DF and ^XF commands in the ZPL programming guide to make sure you are using the templates right, but it is a pretty simple process.
If you are concerned about whether or not the printer is ready to print you could look at the ~hs command to get the current status.
In the end there is a C# and Java SDK available for the printer which has helper functions to push variables store in Maps to a template, but the JNI calls are probably more involved than just opening a TCP connection...
这篇关于Python 将标签发送到 Zebra IP 打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!