打印“原始文本” (ZPL) 来自网络
我们有很多旧的 ZPL 标签。
我们希望能够从网络客户端打印它们。打印机连接到客户端而不是服务器。
我们有一些想法:
从 Silverlight 打印。不可行。似乎无法在不调用 COM 对象的情况下从 .NET 向 Zebra 打印“原始”内容,而这在普通 Silverlight 中是不可能的。
从 Silverlight 中,将 ZPL 视为文件并将其文件复制到打印机。本地打印机必须设置为共享。可以在浏览器外的 Silverlight 中以更高的信任度工作。但如果可能的话,我们希望避免浏览器之外。
如果 Zebra 打印机设置为使用通用/文本驱动程序,我可以在 Notepad.exe 中打开 ZPL 文件,并使用“文件 ->”将 ZPL 发送到打印机。打印。在这种情况下,Zebra 打印机会将文本解释为 ZPL 指令,而不是实际文本。有什么方法可以从浏览器“利用”这个吗?尝试了几种方法,例如简单地在浏览器中打开ZPL文件,然后执行“File ->”打印,但这似乎不起作用。还尝试从 Javascript windows.print();
是否有任何其他插件(java applet、flash 等)能够将原始文本(例如 ZPL)发送到 Zebra 打印机?
将 ZPL 转换为图像(或 pdf:s)。有这样的工具吗?
还有其他想法吗?
We have a lot of old ZPL labels.
We would like to be able to print them from a web client. The printer is connected to the client and not the server.
We have had a few ideas:
Print from Silverlight. Not feasable. Seems to be no way to print "raw" to Zebra from .NET without calling COM object and that is not posible from plain Silverlight.
From Silverlight, treat the ZPL as file and file copy it to printer. Local printer must be setup as shared. Does work from Silverlight Out of Browser with elevated trust. But if posible we would like to avoid Out of browser.
If Zebra printer is set to use Generic/Text driver, I can open a ZPL-file in Notepad.exe and send ZPL to printer using File -> Print. In this case the Zebra printer will interpret the text as ZPL instructions and not actual text. Is there any way to "exploit" this from a browser? Have tried a few ways, for example to simply open the ZPL file in the browser and the do File -> Print but that does not seem to work. Have also tried to print from Javascript windows.print();
Is there any other plugin (java applet, flash, etc.) capable of sending Raw text (e.g. ZPL) to the Zebra printer?
Transform ZPL to images (or pdf:s). Is there any such tool?
Any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Silverlight 5 中,当您打开增强的安全性时,您可以打印原始文本。这是我所做的:
RawPrintHelper 类:
In Silverlight 5 you can print raw text when you turn on enhanced security. Here is what I did:
The RawPrintHelper class:
如果打印机直接连接到网络,您可以打开端口 9100 的套接字并向那里发送 ZPL 代码。
不幸的是,Silverlight 只允许在 端口 4502- 上进行套接字连接4534,除非它以提升的权限运行。您必须将 silverlight 应用程序作为受信任的应用程序运行,将打印机配置为侦听安全端口,或者通过服务器进行中继。
If the printer is connected directly to the network, you can open a socket to port 9100 and send the ZPL code there.
Unfortunately, Silverlight only allows socket connections on ports 4502-4534, unless it is run with elevated privileges. You must either run the silverlight application as a trusted application, configure the printer to listen on a safe port, or relay it trough a server.
您可以使用这个精彩的 Java 小程序 jZebra http://code.google.com/p/jzebra/ 它将原始数据发送到任何打印机。
You can use this wonderful java applet jZebra http://code.google.com/p/jzebra/ it sends raw data to any printer.