With the PFBarcode tag, QR, EAN13 or Code128 codes can be created in the printformer editor. The text to be generated as a code can already be inserted in the InDesign template or later directly in the editor. A PFBarcode block can be created using a graphic or text frame. (If a text frame is chosen also Placeholder with datakeys can be used).
Creating a PF barcode block by using a text frame
Draw a text frame (by using the Type tool) in your document (layer PFUserContent, not printing) and fill it with the content of the code (in this case, steps 3 and 5 can be skipped) or with a placeholder text (depending on the code: text or numbers).
By right-clicking (> tag frame) or via the Tags panel, assign the tag »PFBarcode« to the frame.
Then mark the text and select »PFPlaceholder« by right-clicking (> tag text).
To determine the code type, add a corresponding attribute to the tag »PFBarcode« in the structure (> right click > new attribute), use type as name and enter the code type for the value: qr, ean13 or code128.
In order to be able to enter the content of the code in the printformer editor, the tag »PFPlaceholder« also needs an additional attribute: Name = data-keys, the value is freely selectable or a reference to an existing data source. If a placeholder code should be seen by opening the template in the printformer editor, the attribute Name: use-standard-text-if-empty, Value: true must be added to the tag.
Creating a PF barcode block by using a rectangle frame
If a graphic frame is used as a placeholder for a barcode, it is not visible in the editor until it has been filled with content via the form editor.
Draw a Rectangle Frame in your document (layer PFUserContent, not printing).
Right-click (> tag frame) or use the Tags menu window to assign the tag »PFBarcode« to the frame.
In the structure add an attribute to the tag »PFBarcode« (> right click > new attribute), as name use type and for the value enter the code type: qr, ean13 or code128.
If necessary further attributes with editing restrictions can be added.
In order to be able to insert the content of the code in the printformer editor, the tag needs an additional attribute: name = data-keys, the value is freely selectable or a reference to an existing data source.
In addition, another attribute can be used for the barcodes to reduce the size of the barcode in the block so that a margin is created: name = margin, the value is freely selectable and is specified in point.
The colours of the code can be defined in InDesign by fill and stroke color
Fill color = background color;
Stroke color = front color.
In order to be able to switch colors later in the editor, the fill and/or stroke colour must be defined in InDesign. Also a color set must be assigned to the template in printformer (see Colors). If no color is assigned to the placeholder frame in InDesign, the generated code in the editor is black and has no background color (and cannot be changed later in the editor).
Upload and settings in printformer
After Upload into printformer, the form editor must be activated in the Editor menu. In order to be able to adjust the colors of the codes in the editor, a color set must be selected within color assignment.
Not until the preview/print PDF is generated are the rules (specifications for size ratios/spacing) of Ean and Code128 applied (the display may therefore deviate from the editor). Ean and Code128 are embedded as vectors, QR codes are rasterised as PNG files.
qr, ean13, code128
type of barcode
One or more DataKeys (comma-separated) used to fill the code
Value of the margin to the object frame in pt
all standard attributes/block-settings