Barcodes of different formats can be inserted into documents.

Docmosis provides Code 39, Code 128 and ITF 14 formats.


1) Inserting Barcodes

Inserting barcodes with Docmosis uses a technique similar to inserting images, except that an optional extra field can be used to specify the attributes of the barcode.

An image in the template can be marked with a name, eg "img_barcode1". This image placeholder now determines the size and position of the barcode in the finished document.

In Microsoft Word a Bookmark is assigned to it to identify which piece of data will be used for the value of the barcode. In LibreOffice the name of the image is used instead.

Docmosis will use the data to generate and insert the barcode in place of the image.


2) Barcode Attributes

In addition, a "barcode field" may be defined somewhere in the template to set additional attributes for the barcode. This barcode field links the barcode to a barcode format, for example, the following barcode field sets "barcode1" to be a "code 39" format:


The barcode field can exist anywhere in the template. When the document is rendered, the value for "barcode1" will be looked up and used to create the barcode.

The special field <<barcode: … >> will be removed from the final document.


3) Default Values

The barcode field in the template can specify default settings for the barcode, including the value, resolution and more. The format and the value are the most common, so they can be specified as follows:


eg: <<barcode:barcode1:ABC123:code128>>

specifies barcode1 to have a value of ABC123 and be of type code 128. These settings will be overridden in the data if they are provided.

Other settings such as the resolution can be specified either as a default in the template-field or via the data values. These other settings are specified as key=value pairs. For example, the resolution (dpi) can be specified by:


such a setting (increased resolution) might be required for a small sized barcode.


Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

Applies To

Docmosis-Java Tornado Cloud
Version(s) 4.0.3, 4.1.0, 4.2.0, 4.3.0, 4.3.1, 4.4.0, 4.4.1, 4.4.2, 4.5.0, 4.6.0 (Latest) 2.4, 2.5, 2.6, 2.7, 2.7.1, 2.7.2, 2.7.3, 2.8.0, 2.8.1, 2.8.2 (Latest) ALL

Related items