Unable to get BrowserPrint to work

D Darcy Christ 3 years 6 months ago
610 2 0

I am using this code. It seems to send something to the printing, but nothing is happening.

// BrowserPrint for Zebra Printer
BrowserPrint.getDefaultDevice('printer', function(printer) {
        if((printer != null) && (printer.connection != undefined)) {
            console.log('Using print '+printer.name);
            //printer.send(format_start + txtToPrint + format_end);
            printer.sendUrl(
            'http://domain.com/my-document', // my url is behind a network
            function(success_response) {
            console.log(success_response);
            },
            function(error_response) {
            console.log(error_response);
            },
            );
        } else {
          alert("No Printer Found");
        }
  },
    function(error_response) {
  // This alert doesn't pop either
  alert(    "An error occured while attempting to connect to your Zebra Printer. " +
                "You may not have Zebra Browser Print installed, or it may not be running. " +
                "Install Zebra Browser Print, or start the Zebra Browser Print Service, and try again.");
    }
);
});

The Demo works, using a printer different from the one I have installed. It is called 29j152601705, rather than Zebra GK420t.
I am not sure what I am doing wrong or how to debug this.

Please Register or Login to post a reply

2 Replies

Y Yanis Dalabiras

Hi Darcy,
Browser Print does not use the Windows default printer setup, it has it's own as the use cases for Zebra printers is often specific.
Please check the Browser Print Settings.  If you are printing over a network or would prefer to use a driver for a shared printer, select those settings at the bottom of the form.  Regardless of how you are printing, make sure the printer you want to print to is selected as the default printer.
Robin

D Darcy Christ

I want to follow up with the fact that I can print a PNG file (although the size is huge and I have no idea how to adjust that), but passing an html file to sendURL() does not work. Also, console.log(success_response) prints {} for both. Is there anyway to debug this?

CONTACT
Can’t find what you’re looking for?