Zebra Browser Print Javascript Wrapper for https protocol
npm install zebra-browser-print-wrapper-httpsbash
yarn add zebra-browser-print-wrapper-https
`
Or NPM
`bash
npm i zebra-browser-print-wrapper-https
`
Available Methods
##### getAvailablePrinters()
Return a list of the current available printers
##### getDefaultPrinter()
Gets the current default printer
##### setPrinter()
Sets the printer field
##### getPrinter()
Returns the printer field
##### checkPrinterStatus()
Returns an object indicating if the printer is ready and if not returns the error.
Returned object:
`js
{
isReadyToPrint: boolean;
errors: string
}
`
Possible errors:
- Paper out
- Ribbon Out
- Media Door Open
- Cutter Fault
- Printhead Overheating
- Motor Overheating
- Printhead Fault
- Incorrect Printhead
- Printer Paused
- Unknown Error
##### print(str)
Prints a text string.
You can use this method with simple text or add a string using the ZPL language
Example Angular
`js
// Import the zebra-browser-prit-wrapper package
import ZebraBrowserPrintWrapper from "zebra-browser-print-wrapper-https";
async printLabel() {
try {
// Create a new instance of the object
const browserPrint = new ZebraBrowserPrintWrapper();
// Select default printer
const defaultPrinter = await (browserPrint.getDefaultPrinter());
// Set the printer
browserPrint.setPrinter(defaultPrinter);
// Check if the printer is ready
const printerStatus = await browserPrint.checkPrinterStatus();
if (printerStatus.isReadyToPrint) {
// ZPL script to print a qr code
let zpl = ^XA