Cell.barcode Property
Reads the cell barcode settings, or undefined for a cell without a barcode.
Package: @txtextcontrol/tx-sheet-control-server.
Syntax
readonly barcode: BarcodeOptions | undefined
Example
Use an existing workbook as book.
import { ServerSheetControl as ExampleServer } from '@txtextcontrol/tx-sheet-control-server';
const exampleControl = new ExampleServer();
const book = exampleControl.workbook;
const sheet = book.sheets.at(0);
sheet.cell('A2').setText('000123');
sheet.cell('A2').setBarcode({ symbology: 'code128' });
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.