Barcode Generator

This workflow plugin allows you to generate various barcodes for use outside Goobi itself.


This workflow plugin is used for flexible generation of barcodes in a multi-page PDF file. For this purpose, the user can configure different values in a user interface and define which number of barcodes with which prefix and which counter should be generated. At the same time, the user can specify which XSL file is to be used to generate the PDF file, thus allowing a large degree of freedom with regard to the optical design.





Source code


GPL 2.0 or newer


Goobi workflow 2020.02

Documentation date



To install the plugin the following two files must be installed:


To configure how the plugin should behave, different values can be adjusted in the configuration file. The configuration file is usually located here:


The content of this configuration file looks like this:


    <!--  default value for the number format -->

    <!--  default value for the amount of barcodes to be generated -->

    <!--  default value the first barcode number -->

    <!--  default value the first barcode number -->

    <!--  default separator to use between prefix and counter,
    if the prefix is empty this separator does not get used -->

    <!-- path to xslt file for barcode generation,
    this value can exist multiple times and gets displayed as dropdown list -->


General configuration of the plugin

The plugin is configured within the configuration file mentioned above. There you can define default values for different fields. These are as follows:



This parameter determines whether the counters should be padded with leading zeros. For example, the value 00000 specifies that all numbers are displayed with at least five digits.


This parameter determines how many barcodes are defined.


If the counter for the barcodes is to start at a certain starting value, this value can be defined here.


This parameter defines a prefix that is prefixed to the counter with an underscore _.


With this parameter you can specify a separator to be used between the prefix and the counter. If the prefix is not specified, the separator is not used.


The parameter xslt-path allows the definition of any number of xsl files. The files configured here are then offered to the user for selection within the user interface.

Layout of the barcodes

The barcodes are generated on the basis of so-called XSLT transformation. For this purpose, a PDF file is generated on the basis of an XSL file and then offered for download. The definition of how the PDF file to be generated should look like and which contents it displays and how is done within such an XSL file. Just like the other XSL files that Goobi workflow already uses to generate the routing slips, the XSL files should ideally be located in the central xslt directory of Goobi. This is usually located here:


This folder usually contains several such XSL files. The reference file for the structure of the generated barcodes is located in this file, which is also installed as part of the plug-in installation:


It has the following content:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="" xmlns:fo=""
    xmlns:goobi="" version="1.1" exclude-result-prefixes="fo">
    <xsl:output method="xml" indent="yes" />
    <xsl:template match="goobi:process">
        <fo:root xmlns:fo="">

            <!-- general layout -->
                <fo:simple-page-master master-name="page" page-width="14.8cm" page-height="21.0cm" margin-left="1cm" margin-top="0.7cm"
                    <fo:region-body />

            <!-- run through each item to generate a new page with a barcode -->
            <xsl:for-each select="goobi:item">
                <fo:page-sequence master-reference="page">
                    <fo:flow flow-name="xsl-region-body" font-family="opensans, unicode">

                        <!-- Institution logos -->
                        <fo:block text-align="right">
                            <fo:external-graphic src="/opt/digiverso/goobi/xslt/logo_favicon.png" content-width="10mm" top="0cm"/>

                        <!-- Separator -->
                        <fo:block border-top-width="1pt" border-top-style="solid" border-top-color="#cccccc" margin-top="7pt" />

                        <!-- identifier as readable text -->
                        <fo:block text-align="center" font-weight="bold" font-size="20pt" margin-top="160pt">
                            <xsl:value-of select="." />

                        <!-- Separator -->
                        <fo:block border-top-width="1pt" border-top-style="solid" border-top-color="#cccccc" margin-top="20pt" margin-bottom="20pt" />

                        <!-- Barcode generation -->
                        <xsl:variable name="barcode" select="." />
                        <fo:block text-align="center">
                                <barcode:barcode xmlns:barcode="" message="{$barcode}">

                        <!-- Separator -->
                        <fo:block border-top-width="1pt" border-top-style="solid" border-top-color="#cccccc" margin-top="195pt" margin-bottom="10pt" />

                        <!-- Goobi logo -->
                        <fo:block-container position="fixed" left="1cm" top="19.5cm">
                                <fo:external-graphic src="/opt/digiverso/goobi/xslt/logo.png" content-width="22mm" />

                        <!-- Goobi URL -->
                        <fo:block-container position="fixed" left="11.85cm" top="20.0cm">
                            <fo:block font-size="7pt">


Using the plugin

If the plugin has been installed and configured correctly, it can be found within the menu item Workflow. After entering it, the parameters described above can be adjusted individually in the interface.

After clicking the Generate Barcodes button, a PDF file is available for download. A PDF file with the reference configuration listed here looks like this:

To illustrate the operation, a screencast for the use of the plugin is available here:

Last updated