You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

angular2-pdf417-barcode

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular2-pdf417-barcode

PDF417 barcode generator Module for Angular 2

0.3.0
latest
Source
npmnpm
Version published
Weekly downloads
9
12.5%
Maintainers
1
Weekly downloads
 
Created
Source

Angular2 PDF417 Barcode

PDF417 barcode generator Module for Angular 2

An Angular2 component/module that creates a canvas with a PDF417 barcode from any string input.

pdf417-js

This package uses PDF417-js, which is a direct port of parts of the TCPDF PHP library. The original library is licensed under the LGPL, which also applies to this derivative work.

The version used for porting is tcpdf_6_2_11 or more specific PDF417 class version 1.0.005.

Original port is available on GitHub: [bkuzmic/pdf417-js] [bkuzmic/pdf417-js]: https://github.com/bkuzmic/pdf417-js

Angular 2

This package is for use in the [Angular 2] framework. [Angular 2]: https://angular.io/

Usage

In a parent / shared module, import the PDF417BarcodeComponent, either by exporting the Component as a Directive or simply re-export the provided module:

/* angular */
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule  } from '@angular/forms';

/* third-party */
import { PDF417BarcodeModule } from 'pdf417-module';
...

@NgModule({
  exports: [
    CommonModule,
    FormsModule,
    PDF417BarcodeModule,
  ]
}) export class SharedModule { }

Then use it in your component's template:

...
<div class="barcode">
  <h5>Scan me:</h5>
  <pdf417barcode [text]="'Hello, World!'"></pdf417barcode>
</div>

barcode

options

The component also accepts an opts object with some options:

  • aspect: float aspect ratio of the generated barcode
  • errlvl: [-1 .. 8] error correction level in the barcode, -1 means auto
  • pxw: float pixel width
  • pxh: float pixel height

The default options are:

defaults = { aspect: 4, errlvl: -1, pxw: 1, pxh: 1 }

Use property binding like this:

<pdf417barcode [text]="'Hello, World!'" [opts]="{ pxw: 2, pxh: 2 }"></pdf417barcode>

Keywords

angular2

FAQs

Package last updated on 11 Oct 2016

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