Search code examples
javascriptreactjsprintingweb-applicationszebra-printers

How to connect to a zebra printer using React/JS


We're developing software to connect with Zebra printers on React web application. But we couldn't be successful at this and the zebra sources are outdated!

We couldn't use their SDK because it was outdated and when I imported that webpack gave us so many errors that couldn't compile that code. I'm using this SKD wrapper now: https://www.npmjs.com/package/zebra-browser-print-wrapper

I'm getting network error when I'm trying to print using zebra printer.

instrument.ts:159 GET http://localhost:9100/available net::ERR_BLOCKED_BY_CLIENT
Error: TypeError: Failed to fetch
    at o.<anonymous> (21.5eb25857.chunk.js:sourcemap:2:2238456)
    at 21.5eb25857.chunk.js:sourcemap:2:2237749
    at Object.throw (21.5eb25857.chunk.js:sourcemap:2:2237854)
    at c (21.5eb25857.chunk.js:sourcemap:2:2236607)

I'm using the sample code in the NPM js package that I've shared.

Zebra software and devices are configurated and working but it doesn't work when I'm trying to connect to it using web application.

Does anyone know how to work with it?


Solution

  • There's a need to setup two things first is sdk for react app and second is PC/Mac application that need to be running. This application will expose end points need to be called. Currently it says your PC/MAC application is not running so localhost:9100 not found Check this doumentation https://www.zebra.com/content/dam/zebra_new_ia/en-us/solutions-verticals/product/Software/Printer%20Software/Link-OS/browser-print/zebra-browser-print-user-guide-v1-3-2-en-us.pdf