Pdf - PdfBarcodeValueFormat

18 Nov 20261 minute to read

Specifies how the values of the referenced fields are combined into the barcode payload.

// Create a new PDF document
let document: PdfDocument = new PdfDocument();
// Add a new page
let page: PdfPage = document.addPage();
// Create a barcode field that encodes the values of other fields as XFDF
let field: PdfBarcodeField = new PdfBarcodeField(page, 'barcode', {x: 10, y: 10, width: 100, height: 100}, {
    fields: ['name', 'email'],
    valueFormat: PdfBarcodeValueFormat.XML
});
// Add the field to the form
document.form.add(field);
// Save the document
document.save('output.pdf');
// Destroy the document
document.destroy();
  • CustomScript - The payload is produced by a user supplied calculation script.
  • TabDelimited - Values are separated by a tab character.
  • XML - Values are exported as an XFDF document.