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

vue-zpl-img

v1.0.12

Published

One can render based on VUE, which can generate IMG and ZPL print instructions from local HTML templates CSS templates

Downloads

3

Readme

VueJs2ImgAndZPLPrinter

VueJs2ImgAndZPLPrinter,Can use in Vue2 and JSDomOptions,Change HTML to ZPL or IMG

This is a module that converts front-end HTML into ZPL and images

use this you need install and import node modle Vue2.0,axios,pako (zlib)

Cooperate with the backend to resolve Fastreport .frx Files ,then send HTML and CSS file to FontEnd, It renders useful HTML into image data (Base64) and standard ZPL to printer.

If you have any good suggestions, Please submit :) BUGS EMAIL [email protected]

version 1.0.0 +

parameter

TemplateName(the frx backend filesname send this to backend.) printData(not support frxParmeter now is only C# DataTable) _PrintIP (printer HTTP IP)

printData [1,2,3....]

PrinterOpts{
	blackAndWhite
	rotate
	notrim
	qrcodeScale
	DPI
	PaddingX
	PaddingY
	PrinterIP
}
PostOpts{
	TemplateName
	axios
	PostURL
}
either-or
HTMLOpts{
	HTML
	CSS
	QRcodeParm
}

other
 * @param {Array} _CallBackBase64
 * @param {Array} _CallBackZPL
 * @param {object} _CallPressor
 * @param {function} CallBackFunction

_CallBackBase64 _CallBackZPL _CallPressor and CallBackFunction

Axios requests are currently embedded to help you read a CSS and HTML from the backend. if your dont like this Axios ,You need to pass in your own CSS and HTML

USE

npm install vue-zpl-img


/*axios post example*/
vue-zpl-img({
		PostOpts:{
		  TemplateName:"TemplateName", 						// post to backend
		  axios, 								// You encapsulate Axios
		  PostURL:"http://api/?", 					        // You encapsulate backend api
		},
		printData: [{code:001},{code:002}....],				        // Batch render array
		PrinterOpts:{
				PrinterIP:"http://192.168.0.1"				// ZPL printer IP
		},
		_CallBackBase64: this.handlePrintData.previewImgList,  			// static golobal array,Add images dynamicall
		_CallBackZPL: this.handlePrintData.previewZPL, 				// static golobal array,Add ZPL dynamicall

		_CallPressor:{this._CallPressor}, 					// Dynamically increasing progress also static golobal

		CallBackFunction:(res)={         					// All batch render finished data
			res.CallBackBase64
			res.CallBackZPL
		}
	  })

/*Independent HTML CSS passed in example*/

const HTMLstr = '<div class = "s1" :style='QRcodeBase64' id=\"QRcodeDom\">{{code}}<div><div>{{name}}</div> '
// NOTICE! :style='QRcodeBase64' id=\"QRcodeDom\"  It must be fixed that it will affect VUE rendering !
const CSSstr ='.s1{background : #fff;width :50px;height :50px;}'

vue-zpl-img({
		HTMLOpts:{
		  HTML:HTMLstr,
		  CSS:CSSstr,
		  QRcodeParm:"code", 							 // if you need QRcode, Only one at the moment
		},
		printData: [{code:001,name:'page1'},{code:002,name:'page2'}....],
		PrinterOpts:{
				PrinterIP:"http://192.168.0.1"
		},
		_CallBackBase64: this.handlePrintData.previewImgList,
		_CallBackZPL: this.handlePrintData.previewZPL,

		_CallPressor:{this._CallPressor},

		CallBackFunction:(res)={
			res.CallBackBase64
			res.CallBackZPL
		}
	  })