Pdf - PdfQRInputMode

18 Nov 20261 minute to read

Specifies how the payload of a QR Code barcode is encoded.

// Create a new PDF document
let document: PdfDocument = new PdfDocument();
// Add a page to the document
let page: PdfPage = document.addPage();
// Create a QR barcode in alphanumeric mode
let barcode: PdfQRBarcode = new PdfQRBarcode('INVOICE-2026-000123');
barcode.inputMode = PdfQRInputMode.AlphaNumeric;
barcode.draw(page, { x: 40, y: 40, width: 32, height: 32 });
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • AlphaNumeric - Specifies alphanumeric mode which accepts 0-9, A-Z, space and $ % * + - . / :
  • Byte - Specifies byte mode which converts the text to bytes using textEncoding.
  • Mixed - Specifies mixed mode which automatically splits the input into
    numeric, alphanumeric and byte segments.
  • Numeric - Specifies numeric mode which accepts only the digits 0 through 9.