Socket
Socket
Sign inDemoInstall

print-tag

Package Overview
Dependencies
4
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    print-tag

Simple module to generate PDF tags for print in comercial formats


Version published
Weekly downloads
148
increased by7.25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Print tags node.js module

NPM version Build Status Coverage Status

Simple module to print tickets / user tags

Installation

npm install --save print-tag

Usage

// See all avaible formats in: https://github.com/albertosouza/print-tag/blob/master/lib/formats.js 
var pt = new PrintTicket('pimaco_6187');
// write in test/results/output.pdf , see PDFkit documentation
pt.doc.pipe( fs.createWriteStream('test/results/output.pdf') );
pt.doc.fontSize(6);

pt.makeTickets({
  count: data.length
}, function onSetOneTag(i, marginLeft, marginTop, size, next) {
  // write something in tag area
  pt.doc.text(data[i].name, marginLeft,  marginTop, size);
  // ticket box
  pt.doc.lineWidth(0.1);
  pt.doc.rect(marginLeft, marginTop, size.width, size.height).stroke();
  // run next function
  next();
}, function afterSetAllTags(){
  // end, required for end / finish the PDF file
  pt.doc.end();
});

pt.doc.on('end', function(){
  done();
});

Formats

Please help with more formats in: https://github.com/albertosouza/print-tag/blob/master/lib/formats.js

Avaible:

  • pimaco_6187

Authors

License

MIT © Alberto Souza

Keywords

FAQs

Last updated on 18 May 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc