This package has been deprecated

Author message:

Please switch to new package 'pdf417-barcode', which is packaged for Angular 6+.

angular2-pdf417-barcode

0.3.0 • Public • Published

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

Angular 2

This package is for use in the Angular 2 framework.

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>

Package Sidebar

Install

npm i angular2-pdf417-barcode

Weekly Downloads

6

Version

0.3.0

License

LGPL-3.0

Last publish

Collaborators

  • ansemjo