Barcode Image Generation in Word Processing Document

Note
The example reads the shop data described in The Business Layer.

Barcode Generation in Microsoft Word

Template Syntax

  • Add a textbox to your template at the place where you want a barcode image to be inserted.
  • Add the following syntax:
<<barcode [customer.Barcode] -codabar>>
Tip
For detailed technical information about syntax, expressions and report generation by the engine, please visit: Working with GroupDocs.Assembly Engine

Download Template

Get the template from here.

The Code

import json

from groupdocs.assembly import DataSourceInfo, DocumentAssembler

with open("customer.json", encoding="utf-8") as f:
    customer = json.load(f)

assembler = DocumentAssembler()
assembler.assemble_document("barcode.docx", "barcode-report.docx", DataSourceInfo(customer, "customer"))

The following sample file is used in this example: barcode.docx

The following sample file is used in this example: customer.json

Binary file (DOCX, 12 KB)

Download full output

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.