Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is a subclass of Code and is used to generate a barcode element

Hierarchy

Index

Constructors

constructor

  • new BarCode(name: string, data: string, type: string, height?: number, width?: number, errorcorrectlevel?: string, url?: string, rotation?: number, backgroundColor?: string, paddingWidth?: number, paddingHeight?: number, extraOptions?: string): BarCode
  • Parameters

    • name: string

      The name for this Code object (Cloud Office Print tag).

    • data: string

      The data for this Code object.

    • type: string

      For the different types of QR-codes and barcodes, we refer to the Cloud Office Print documentation.

    • Optional height: number

      The height for the generated code. The default is 200 for QR, 50 for the rest. Optional.

    • Optional width: number

      The width for the generated code. The default is 200. Optional.

    • Optional errorcorrectlevel: string

      The level of which the QR code should be recoverable. The options are: "L" (up to 7% damage) "M" (up to 15% damage) "Q" (up to 25% damage) "H" (up to 30% damage). Optional.

    • Optional url: string

      The URL to hyperlink to when the barcode/qrcode is clicked. Optional.

    • Optional rotation: number

      The rotation angle of the barcode/qrcode (in degrees, counterclockwise). Optional.

    • Optional backgroundColor: string

      The background color for the barcode/qrcode. default: white/ffffff. You can provide a hex value; html named colors like red, white, purple; rgb(255, 0, 0) or any other css supported format. Optional.

    • Optional paddingWidth: number

      The width padding of the inserted qrcode/barcode. default 10. In pixels. Optional.

    • Optional paddingHeight: number

      The height padding of the inserted qrcode/barcode. default 10. In pixels. Optional.

    • Optional extraOptions: string

      If you want to include extra options like including barcode text on the bottom. The options should be space separated and should be followed by a "=" and their value. E.g.: "includetext guardwhitespace guardwidth=3 guardheight=3". Please visit https://github.com/bwipp/postscriptbarcode/wiki/Symbologies-Reference for all the options. Optional.

    Returns BarCode

Properties

backgroundColor

backgroundColor: undefined | string

data

data: string

errorcorrectlevel

errorcorrectlevel: undefined | string

extraOptions

extraOptions: undefined | string

height

height: undefined | number

name

name: string

paddingHeight

paddingHeight: undefined | number

paddingWidth

paddingWidth: undefined | number

rotation

rotation: undefined | number

type

type: string

url

url: undefined | string

width

width: undefined | number

Methods

asDict

  • asDict(): {}
  • The dict representation of this object

    Returns {}

    dict representation of this object

    • [key: string]: string | number | boolean

asDictSuffixes

  • asDictSuffixes(): {}
  • Get the suffixes that need to be appended to the keys of the dict representation of this Code object.

    Returns {}

    the suffixes that need to be appended to the keys of the dict representation of this Code object

    • [key: string]: string | number | boolean

availableTags

  • availableTags(): Set<string>

Generated using TypeDoc