Barcodes
PDF417
Pdf417 from @salmonui/charts/barcode/pdf417: Text, Numeric and Byte compaction, error correction levels 0 to 8, columns, rows, Compact PDF417 and the row height ratio.
import { Pdf417 } from '@salmonui/charts/barcode/pdf417';
import '@salmonui/charts/barcode/styles.css';
<Pdf417 value="PDF417 Symbology Standard" errorCorrection={1} columns={2} />;
Pdf417 lives in @salmonui/charts/barcode/pdf417: it shares the SVG output, color, size,
quiet zone, label, invalid-value and BarcodeApi export options of Barcode
and uses the barcode stylesheet. It is a subpath of its own so a page that
only needs 1D codes or QR codes never downloads its encoder (and this one
never downloads theirs). The encoder follows
ISO/IEC 15438 and reproduces the standard's published example symbols module
for module.
compaction: 'auto' | 'text' | 'numeric' | 'byte':'auto'(default) uses the ISO selection: 13 or more digits go to Numeric Compaction, runs of 5 or more text characters to Text Compaction (with its upper, lower, mixed and punctuation sub-modes), everything else to Byte Compaction. A forced mode that cannot encode the value (letters in'numeric', bytes outside printable ASCII, tab, CR and LF in'text') renders the invalid state. The value is ISO 8859-1 text.errorCorrection: 'auto' | 0 … 8: levelnadds2^(n + 1)Reed-Solomon codewords over GF(929).'auto'is the ISO recommended minimum for the data length (level 2 up to 40 data codewords, 3 up to 160, 4 up to 320, else 5).columns(1 to 30) androws(3 to 90): either, both or neither; by default the column count gives a symbol about twice as wide as it is high. A value that does not fit renders the invalid state (928 codewords at most).compact: Compact PDF417 (truncated): no right row indicator, and the stop pattern becomes a one-module bar.rowHeightRatio: row height in modules (default 3, the ISO minimum);heightscales the rows instead.moduleSizedefaults to 2 px; the quiet zone is 2 modules. No human-readable text is drawn unlesstextis set.
Like Barcode, the symbol is one <svg role="img"> named by label
(default the value), renders its final markup on the server and draws only
as SVG (see
Barcode).
ref gives a BarcodeApi for toSVGString, toBlob, toDataURL and
export. All props and types are in the
API reference.
PDF417 layouts
Open demoPDF417 with automatic columns and error correction, a fixed two-column level 1 symbol and Compact PDF417 with taller rows.