TX Sheet Control

DrawingCollection.addBarcode Method

Method

Inserts a movable barcode or QR code. Missing source/value reads its anchor cell.

Package: @txtextcontrol/tx-sheet-control-server.

Syntax

owner.addBarcode(options);

Examples

Use an existing workbook as book.

import { ServerSheetControl as ExampleServer } from '@txtextcontrol/tx-sheet-control-server';
const exampleControl = new ExampleServer();
const book = exampleControl.workbook;
book.sheets.at(0).drawings.addBarcode({
    symbology: 'qrCode', source: '=A2', anchor: { cell: 'D2' },
    size: { width: 160, height: 160 }
});
exampleControl.destroy();

Remarks

Settings are detached snapshots. Cell values and formulas remain available beneath the symbol. Sources resolve after calculation and mail merge. See Barcodes and QR Codes for validation, supported payloads and XLSX behavior.