npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sbenitez73/cordova-ble-zbtprinter

v1.0.7

Published

This plugin globally defines the different actions that the printer can have, such as print, obtain ZPL code, print, etc.

Downloads

6

Readme

@sbenitez73/cordova-ble-zbtprinter

npm version

This plugin is built so that it can be used with Zebra thermal printers, through bluetooth, we can print images and whatever we want with Zebra's ZPL or CPCL programming language.

Installation

npm i @sbenitez73/cordova-ble-zbtprinter

Usage

Import printer instance from @sbenitez73/cordova-ble-zbtprinter:

import ZbtPrinter from '@sbenitez73/cordova-ble-zbtprinter';

You can send data in ZPL, CPCL Zebra Programing Language:

let printText = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ";
ZbtPrinter.print( MACAddress, printText, 
    (success) => {
        alert("Printed successfully");
    }, ( error ) => {
        alert( error );
    }
);

Converts the image and returns it with the position indicated in the properties (only available with CPCL code):

ZbtPrinter.convertImage(imageRoute, position,
    (printerName) => { 
        alert("Printer name: " + printerName); 
    }, (fail) => { 
        alert(fail); 
    }
);

Discover nearby bluetooth Zebra printers:

ZbtPrinter.discoverPrinters(
    (MACAddress) => { 
        alert("discovered a new printer: " + MACAddress); 
    }, (error) => { 
        alert(error); 
    }
);

You can get a status response from a connected Zebra printer using:

ZbtPrinter.getStatus(address,
    (success) => {
        alert("Zbtprinter status: " + success);
    },(error) => {
        alert("Zbtprinter error: " + failerror);
    }
);

Retrieve the currently connected printer name:

ZbtPrinter.getPrinterName(MACAddress,
    (printerName) => { 
        alert("Printer name: " + printerName); 
    }, (fail) => { 
        alert(fail); 
    }
);

ZPL equivalent code from Base64

Get ZPL equivalent code from the base64 Image string (return only ZPL code):


let base64Image: string = base64String;
let addHeaderFooter: boolean = false;    	//Want to add header/footer ZPL code or not
let blacknessPercentage: number = 50;		//Blackness Percentage

ZbtPrinter.getZPLfromImage(base64Image, addHeaderFooter, blacknessPercentage,
    (zplCode) => {
        alert("ZPL Code : " + zplCode);
    }, (error) => {
	    alert(error);
    }
);

ZPL - Zebra Programming Language

For more information about ZPL please see the PDF Official Manual

CPCL - Zebra Programming Language

For more information about CPCL please see the PDF Official Manual