Pdfviewer - BarcodeFieldSettings

18 Nov 20262 minutes to read

The BarcodeFieldSettings is used to show and customize the appearance of the barcode form field element.

<div id="pdfViewer" style="height: 100%;width: 100%;"></div>
 let viewer: PdfViewer = new PdfViewer();
 // Change the barcode field settings.
 viewer.barcodeFieldSettings = {
     bounds: { x: 0, y: 0, width: 0, height: 0 },
     name: '',
     pageNumber: 0,
     tooltip: '',
     symbology: 'PDF417',
     xDimension: 4,
     errorCorrectionLevel: 'Level5',
     valueFormat: 'TabDelimited',
     fields: [],
     includeFieldNames: true,
     compressData: false,
     customValue: '',
     caption: ''
 };
 viewer.appendTo("#pdfViewer");

Properties

bounds IFormFieldBound

Defines the bounds of the barcode form field.
Specifies the X and Y coordinates along with width and height.

Defaults to { x: 0, y: 0, width: 0, height: 0 }

caption string

Gets or sets the caption displayed with the barcode.

Defaults to ’’

compressData boolean

Gets or sets whether generated data
should be compressed before encoding.

Defaults to false

customData object

Gets or sets the custom data associated with the form field.

Defaults to null

customValue string

Gets or sets the custom barcode value. This value is encoded directly into the barcode when valueFormat is set to CustomValue.

Defaults to ’’

errorCorrectionLevel Pdf417ErrorCorrectionLevel|QRErrorCorrectionLevel

Gets or sets the barcode error correction level.
PDF417:

  • Level0 to Level8

QRCode:

  • Low
  • Medium
  • Quartile
  • High

DataMatrix does not use this setting.

Defaults to ‘Level5’

fields string[]

Gets or sets the source field names used
to generate barcode content.

Defaults to []

includeFieldNames boolean

Gets or sets whether field names are included
in the generated barcode content.

Defaults to true

name string

Defines the unique name of the barcode form field.

Defaults to ’’

pageNumber number

Defines the page number on which the barcode form field is rendered.

Defaults to 0

symbology BarcodeSymbology

Gets or sets the barcode symbology.
Supported values:

  • PDF417
  • QRCode
  • DataMatrix

Defaults to ‘PDF417’

tooltip string

Defines the tooltip text displayed when hovering over the barcode form field.

Defaults to ’’

valueFormat BarcodeValueFormat

Specifies the format used to generate barcode content.

Defaults to ‘TabDelimited’

xDimension number

Gets or sets the barcode module width.

Defaults to 4