BarcodeDrawingOptions Interface
Floating barcode settings with ordinary drawing placement. Inherits every BarcodeOptions setting.
Package: @txtextcontrol/tx-sheet-control.
Syntax
interface BarcodeDrawingOptions extends BarcodeOptions {
anchor?: Anchor;
size?: Size;
name?: string;
altText?: string;
rotation?: number;
}
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.
anchor — Anchor cell and optional CSS-pixel offsets. Defaults to A1.
size — Width and height in unscaled CSS pixels. Defaults to 160×160 for QR or 280×100 for linear codes.
name — Drawing name; defaults to Barcode.
altText — Accessibility description for the drawing.
rotation — Clockwise rotation in degrees.
Inherited settings: BarcodeOptions.
Examples
Create a barcode from application data and retain its editable workbook settings.
import { Workbook } from '@txtextcontrol/tx-sheet-control';
import type { BarcodeDrawingOptions } from '@txtextcontrol/tx-sheet-control';
const book = new Workbook();
const sheet = book.sheets.at(0);
sheet.cell('A1').setText('001042');
const options: BarcodeDrawingOptions = {
symbology: 'code128', source: 'A1',
anchor: { cell: 'D4', offsetX: 8, offsetY: 8 },
size: { width: 240, height: 100 }, name: 'Invoice barcode',
altText: 'Invoice identifier', rotation: 0,
};
const drawing = sheet.drawings.addBarcode(options);
const snapshot = drawing.barcode;
if (snapshot) {
drawing.updateBarcode({ ...snapshot, showText: false });
}
Additional and Inherited Members
| Member | Ownership |
|---|---|
| symbology | Inherited from BarcodeOptions. |
| source | Inherited from BarcodeOptions. |
| value | Inherited from BarcodeOptions. |
| showText | Inherited from BarcodeOptions. |
| foreground | Inherited from BarcodeOptions. |
| background | Inherited from BarcodeOptions. |
| errorCorrection | Inherited from BarcodeOptions. |
| version | Inherited from BarcodeOptions. |