Can you direct pdf print to a zebra printer
Asked Answered
S

6

8

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?

The zebra printer works fine when printed through Acrobat Reader, does Adobe Reader translate the PDF into zpl?

Scott answered 22/7, 2014 at 12:52 Comment(3)
nope. Printing from Acrobat using a driver rasters the pdf into zpl and prints that way. If you can convert the PDF into an image, and then convert and store the image on the printer (zebra has an SDK to dither and convert to 1-bit-per-pixel BW image), you can print that image by recalling it with some zplEtz
@OviTisler Would that work from an Android device too? Namely, could you print a PDF or an image from an Android device to a Zebra printer?Detruncate
yeah, if you use the Zebra android SDKEtz
L
16

The zebra printer works fine when printed through Acrobat Reader, does Adobe Reader translate the PDF into zpl?

No. Adobe Reader prepares a document that the system's print service can consume. The print service then invokes the Zebra drivers, and those are 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.

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.

Lugsail answered 27/7, 2014 at 6:55 Comment(7)
If you `speak' directly to your printer in its native language, then you're coupling your application to a proprietary language, aren't you? Isn't there a cleaner way to keep the generation of labels agnostic of the printer? I'm thinking about images or PDFs, even more declarative languages. Sorry if I'm missing the point but it seems to me that this problem has been solved years ago on desktop printers but I still fail to see why I'd have to delve into those CPCL or ZPL languages if I can avoid to.Detruncate
ZPL, CPCL and EPL are relatively small, targeted languages for creating labels, and a bunch of printers have compatibility with them, either directly or through drivers. If they fulfill your needs, then there's no need to go through a more complex route. For example, the stuff my employer does requires specific truetype fonts and other things that are difficult in ZPL, which is why we build images or PDFs and let the print service take care of the translation. It's all about the right tool for the right job.Lugsail
I understand. Assuming that you know the printer resolution (dpi), do you manage to render sharp labels using images? I'm concerned there may be losses when rendering images.Detruncate
Yeah, we match DPI and label size. All of the desktop Zebra printers are 203 DPI, for example. Sharpness has never been a problem, as long as the images remain purely black and white. Any shades of grey present will get dithered, poorly.Lugsail
Much obliged, @Charles. That was very helpful.Detruncate
fyi: I am currently implementing a SVG to EPL/ZPL/Fingerprint compiler: github.com/dittodhole/dotnet-Svg.Contrib.Render - this will be only implemented in .NET, but the code isn't that sophisticated ....Vedetta
Actually, you can print directly from Java into a Zebra ZPLII driver LEVERAGING the Apache PDFBox library. I think my colleague will post the solution.Nabalas
G
2

A better but slightly not so reusable way is to use ZPL or EPL (whatever your particular zebra printer supports).

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)

^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.

Gardal answered 7/11, 2014 at 15:16 Comment(0)
L
2

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.

https://www.zebra.com/us/en/products/software/barcode-printers/link-os/pdf-virtual-device.html

Laxative answered 10/6, 2019 at 22:13 Comment(0)
T
1

To complete Justin answer, Link_OS printers addon PDF-direct is free for over the year. Just update to latest printer firmware, and same way upload PDF-direct addon to printer. Then pdf printing with generic text driver just working. Also tested on value series ZD220 ans ZD230 printers.

Tripletail answered 30/6, 2022 at 8:36 Comment(0)
I
0
  • Download Zebra setup printer on ios :
    https://apps.apple.com/us/app/zebra-printer-setup-utility/id1454308745.

  • Then go to Device Language, and choose PDF.

  • Then a simple post request like :

    const pdfData = {
          uri: localUrl, // <- your file
          type: 'application/pdf',
          name: 'file_name',
      }
    
      const data = new FormData()
      data.append('pdf', pdfData)
    
      fetch(printerUrl, { // <- "http://${IP}:9100/pstprnt/"
          method: 'POST',
          headers: {
              'Content-Type': 'multipart/form-data',
          },
          body: pdfData,
      })
    
Ingratiate answered 22/2, 2021 at 16:44 Comment(1)
@CarlosFranco yes, did you try it ?Ingratiate
D
-1

You can print a PDF to a Zebra printer using the Mobi Print Utility for android and iOS. It can print bluetooth or wifi.

Dillion answered 28/1, 2016 at 20:37 Comment(1)
Can you please share us the link for Android (Playstore link) for this appBaileybailie

© 2022 - 2024 — McMap. All rights reserved.