🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

ng-qrgen

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-qrgen

Fast and easy QR code generator (Angular v2+).

1.0.5
latest
Source
npm
Version published
Weekly downloads
1
-92.86%
Maintainers
1
Weekly downloads
 
Created
Source

Fast and easy QR code generator (Angular v2+).

NgQrGen

An Angular (v2+) Component wrapper for: https://www.npmjs.com/package/qrcode Create QR Codes easily and dynamic.

Image

Installation

npm i ng-qrgen

Add NgQrgenModule to your angular module.

Usage

<ng-qrgen [value]="'StringValue'" [options]="options"></ng-qrgen>

Options

The options interface can be found at
import { QrGenOptions } from 'ng-qrgen';
Which looks like:

{
    version: number;
    type: GenerationType;
    imageType?: ImageType;
    errorCorrectionLevel?: ErrorCorrectionlevel;
    margin?: number;
    scale?: number;
    width: number;
    maskPattern?: number;
    color?: {
        dark: string,
        light: string,
    };
}
  • version: The QR code version (1-40), higher means more black squares.
  • type: Image, Canvas, or Svg.
  • imageType: If you chose Image at type, determine which image type to use: Png, Jpeg, or Webp.
  • errorCorrectionLevel: The level of error correction: Low, Medium, Quartive, High. (See: https://www.npmjs.com/package/qrcode#error-correction-level).
  • margin: White space around the edges.
  • scale: Scale factor. A value of 1 means 1px per modules (black dots).
  • width: Size of the QR code.
  • maskPattern: Mask pattern used to mask the symbol.
  • color: The dark and light colors. Use Hex-codes.

Static Methods

import { NgQrGen } from 'ngqrgen';
Usage:

  • NgQrGen.generateEncodedDataUrl(value: string, options: QrGenOptions): Generates an base-64 encoded data url string as QR code source. Can be used in the src property of an image.
  • NgQrGen.generateString(value: string, options: QrGenOptions): Generates an svg element as string.

Keywords

QR

FAQs

Package last updated on 03 May 2019

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