SpreadJS Documentation
Setting PDF417
SpreadJS Documentation > Developer's Guide > Managing Data Visualization and Objects > Working with Barcodes > Setting PDF417

PDF417 barcode is a popular high-density, two-dimensional barcode with symbology that possesses the capability to encode up to 1108 bytes of information. This barcode comprises a stacked set of small barcodes and can encode up to 35 alphanumeric characters and 2,710 numeric characters.

A screenshot depicting PDF417 barcode sparkline is shared below.

Formula definition

You can set PDF417 sparkline in a worksheet using the following formula:

=BC_PDF417(value, color, backgroudColor, errorCorrectionLevel, rows, columns, compact, quietZoneLeft, quietZoneRight, quietZoneTop, quietZoneBottom)

Parameter

Name Description
value A string that represents encode on the symbol of QRCode.
color A color that represents the barcode color. The default value is 'rgb(0,0,0)'.
backgroundColor A color that represents the barcode backgroundcolor. The default value is 'rgb(255, 255, 255)'
errorCorrectionLevel A string that represents the error correction level of PDF417. It has 'auto|0-8' values. The default value is 'auto'.
rows A value that specifies the number of rows in the symbol. It has 'auto|3-90' values.The default value is 'auto'.
columns A value that specifies the number of columns in the symbol. It has 'auto|1-30' values. The default value is 'auto'.
compact Specifies whether it is a compact PDF417. The default value is 'false'.
quietZoneLeft A value that represents the size of left quiet zone.
quietZoneRight A value that represents the size of right quiet zone.
quietZoneTop A value that represents the size of top quiet zone.
quietZoneBottom A value that represents the size of bottom quiet zone.

Using Code

This example code sets PDF417 sparkline in the worksheet.

JavaScript
Copy Code

var sheet = spread.getActiveSheet();

// Set PDF417 Barcode Sparkline
sheet.setValue(3, 1, "PDF417", GC.Spread.Sheets.SheetArea.viewport);
sheet.setValue(3, 2, "6935205311092", GC.Spread.Sheets.SheetArea.viewport);

// Set Style
sheet.setRowHeight(3, 100);
for (var col = 1; col < 4; col++)
{
    sheet.setColumnWidth(col, 200);
}
sheet.getRange(3, 0, 1, 4).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
sheet.getRange(3, 0, 1, 4).vAlign(GC.Spread.Sheets.VerticalAlign.center);

// Set Formula
sheet.setFormula(3, 3, '=BC_PDF417(C4)');