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

ionic-zebra-label-printer

v1.0.0

Published

print labels with an zebra label printer on the local network

Downloads

23

Readme

Plugin information

This plugin will enable your Ionic Cordova project to print using a Zebra printer. It's written to use TCP sockets for the native Android and iOS. In a browser version it will use a post request. If you are planning to use it in a web version served from HTTPS be warned, the Zebra printer only allows http calls. This causes Mixed Content issues if your not able to update the browser flag on the devices that will be used this will be a mayor issue.

Usage

You need to import the plugin in the file in which you want to call your print actions:

import { Plugins } from '@capacitor/core';

import 'ionic-zebra-label-printer';
const { ZebraLabelPrinter } = Plugins;

Initialise the printer object by passing the ip of the printer, port on which it is accessible (default for zebra is 9100) and code you want to print.
Use the print object within the call to start printing.

let PrintObj = {
			ip: "xxx.xxx.xxx.xxx",
			port: xxxx,
			zpl: "your zpl formatted string"
		};

await ZebraLabelPrinter.print(PrintObj)
		.then(
			(res)=>{
			},
			(err)=>{
			}
		).finally(()=>{
		});

Android

This version is tested on physical devises (zebra scanner to printer and android phone to printer)

This requires some manual steps to use this plugin on android

Within the main activity you need to import the plugin and add it within the init function

    import nl.appcomm.zebraLabelPrinter.ZebraLabelPrinter; // <-- add this line

   	// Initializes the Bridge
    this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
      // Additional plugins you've installed go here
      // Ex: add(TotallyAwesomePlugin.class);
      add(ZebraLabelPrinter.class); // <-- add this line
    }});

iOS

The iOS version is written with the use of the SwiftSocket pod. After building your project it could complain about;

  • the deployment target
  • the swift version

Both are easily solvable

Deployment target

While having xcode open press on the Pods.xcodeproj > SwiftSocket (whithin the Targets section) > General (tab) > Deployment Info Here you select the target needed.

Swift version

While having xcode open press on the Pods.xcodeproj > SwiftSocket (whithin the Targets section) > Build Settings (tab) > Swift Language Version Here you select the needed version

Web

The web version of this plugin uses an alternative method. It uses the post request option provided by zebra. Howver in order to uses this option you will need to enable a browser flag. This approach differs for each browser. In order to alter the flag you will need to search for "allow mixed content"