New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jspdf-barcode

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jspdf-barcode

barcode generator plugin for jspdf

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
183
decreased by-59.24%
Maintainers
0
Weekly downloads
 
Created
Source

Demo

https://castrix.github.io/jspdf-barcode

Code

Why should I use jspdf-barcode?

The barcode that is generated by this library will not break when zoomed in/printed out since it's not generating picture/pixel

Installation

npm install jspdf jspdf-barcode --save

Ussage

require jspdf >= 2.0.0

ES6

import jsPDF from "jspdf"; // please use default import
import jspdfBarcode from "jspdf-barcode";

const doc = new jsPDF()
jspdfBarcode(doc, "barcodeValue", {
    fontSize: 23,
    textColor: "#000000",
    x: 5.4,
    y: 25.5,
    textOptions: { align: "center" } // optional text options
  })

CJS

const { jsPDF } = require("jspdf")
const jspdfBarcode = require("jspdf-barcode").default // use .default

const doc = new jsPDF()
jspdfBarcode(doc, "barcodeValue", {
    fontSize: 23,
    textColor: "#000000",
    x: 5.4,
    y: 25.5,
    textOptions: { align: "center" } // optional text options
  })

Support

Currently only support Code 128 Barcode

Arguments

argumentstypeaccepted value
docstringjspdf instance
barcodeValuestringalphanumeric
optionsobjectfontSize number,
textColor string,
x: number // x coordinate of pdf,
y: number // y coordinate of pdf,
textOptions(optional)

Keywords

FAQs

Package last updated on 21 Jan 2025

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc