Java 你能把pdf打印到斑马打印机吗
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24887961/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can you direct pdf print to a zebra printer
提问by user2982867
Is it possible to direct print a stored pdf via a zebra printer in Java? I can't find any mention of them being compatible with direct printing and I can't get it to print. Would I need to communicate directly via zpl?
是否可以通过 Java 中的 zebra 打印机直接打印存储的 pdf?我找不到任何提及它们与直接打印兼容的内容,也无法打印。我需要通过 zpl 直接通信吗?
The zebra printer works fine when printed through Acrobat Reader, does Adobe Reader translate the PDF into zpl?
zebra 打印机在通过 Acrobat Reader 打印时工作正常,Adobe Reader 是否将 PDF 转换为 zpl?
回答by Charles
The zebra printer works fine when printed through Acrobat Reader, does Adobe Reader translate the PDF into zpl?
zebra 打印机在通过 Acrobat Reader 打印时工作正常,Adobe Reader 是否将 PDF 转换为 zpl?
No. Adobe Reader prepares a document that the system's print service can consume. The print service then invokes the Zebra drivers, and thoseare what convert the document into the printer's native language. This is how all print drivers work on all platforms, not just on Windows. CUPS does the same thing on Linux and MacOS.
不可以。Adobe Reader 准备系统打印服务可以使用的文档。然后打印服务调用 Zebra 驱动程序,这些驱动程序将文档转换为打印机的本地语言。这就是所有打印驱动程序在所有平台上的工作方式,而不仅仅是在 Windows 上。CUPS 在 Linux 和 MacOS 上做同样的事情。
Don't spend time building a PDF => image => ZPL translator. Your time will be better spent simply having your application speak to the OS native print service. I don't do Java, but a bit of time on my search engine of choice suggests that Java seems to support printing this way.
不要花时间构建 PDF => 图像 => ZPL 翻译器。只需让您的应用程序与操作系统本机打印服务对话,您的时间就会更好。我不使用 Java,但是在我选择的搜索引擎上的一些时间表明 Java 似乎支持这种打印方式。
回答by user3054067
A better but slightly not so reusable way is to use ZPL or EPL (whatever your particular zebra printer supports).
一种更好但不太可重用的方法是使用 ZPL 或 EPL(无论您的特定 zebra 打印机支持什么)。
By the way ZPL is Zebra programming language which is proprietary to Zebra. You can directly write the ZPL String on to the serial or parallel port without installing any Zebra driver (rather using Windows Generic Text Printer driver). For example you can send following string directly to printer port (Serial, Parallel or Network)
顺便说一下,ZPL 是 Zebra 专有的 Zebra 编程语言。您可以直接将 ZPL 字符串写入串行或并行端口,而无需安装任何 Zebra 驱动程序(而使用 Windows 通用文本打印机驱动程序)。例如,您可以将以下字符串直接发送到打印机端口(串行、并行或网络)
^XA^FO40,40^AC2,20^FD^FS^FO40,60^BY2,2.8,10^BCN,100,Y,N,N^FD Barcode label ^FS^XZ
Hope it helps.
希望能帮助到你。
回答by Printer Guru
You can print a PDF to a Zebra printer using the Mobi Print Utility for android and iOS. It can print bluetooth or wifi.
您可以使用适用于 Android 和 iOS 的 Mobi 打印实用程序将 PDF 打印到 Zebra 打印机。它可以打印蓝牙或wifi。
回答by Justin Bennett
If you have a printer with Link-OS you can purchase and install PDF Direct from Zebra on the printer firmware. You can then send a pdf directly to the printer. We do this by connecting to port 9100 and sending the PDF.
如果您有配备 Link-OS 的打印机,您可以从 Zebra 购买并在打印机固件上安装 PDF Direct。然后,您可以将 pdf 直接发送到打印机。我们通过连接到端口 9100 并发送 PDF 来做到这一点。
https://www.zebra.com/us/en/products/software/barcode-printers/link-os/pdf-virtual-device.html
https://www.zebra.com/us/en/products/software/barcode-printers/link-os/pdf-virtual-device.html