Pdf - Pdf417ErrorCorrectionLevel
18 Nov 20261 minute to read
Specifies the error correction level for a PDF417 barcode.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Access first page
let page: PdfPage = document.getPage(0);
// Create a PDF417 barcode
let barcode: Pdf417Barcode = new Pdf417Barcode('PDF417 payload');
barcode.text = 'Hello World';
barcode.errorCorrectionLevel = Pdf417ErrorCorrectionLevel.Level2;
barcode.draw(page, { x: 10, y: 20, width: 200, height: 100 });
document.save('output.pdf');
document.destroy();-
Auto- Specifies automatic ECC level selection based on data length. -
Level0- Specifies ECC level 0 (2 ECC words). -
Level1- Specifies ECC level 1 (4 ECC words). -
Level2- Specifies ECC level 2 (8 ECC words). -
Level3- Specifies ECC level 3 (16 ECC words). -
Level4- Specifies ECC level 4 (32 ECC words). -
Level5- Specifies ECC level 5 (64 ECC words). -
Level6- Specifies ECC level 6 (128 ECC words). -
Level7- Specifies ECC level 7 (256 ECC words). -
Level8- Specifies ECC level 8 (512 ECC words).