Insert line breaks in a 2D barcode

Insert line breaks in a 2D barcode

You have two options, if you want to insert a line break in a 2D barcode (like PDF417, Datamatrix and QR barcodes):

 

1.If you want to insert a simple line break with the full Carriage Return (CR) and Line Feed (LF), then you can insert a line break by defining a string and press Enter while editing the string.

2.You can also specifically specify the hex values of each character.

 

 

Insert a simple line break in a 2D barcode

To insert a simple line break in a 2D barcode you can e.g. define a variable, that contains a single character, that is a line break.

 

You can do that by defining the variable in this way:

 

NG2VariableLineBreak0001

 

The value for the variable, LineBreak is defined above by typing two single quotes and pressing Enter after the first one.

 

Now you can use the variable (if you insert the barcode after the variable update) e.g. with the concat Xpath function like this:

 

concat('abc',$LineBreak,'def')

 

NG2VariableLineBreak0002

 

 

Insert a line break as either CR, LF or both

You can also insert the line break as either CR (Carriage Return), LF (Line Feed) or both in a barcode. To do that you first need to know the hex codes of both characters, and they are:

 

LF, Line Feed has the hex value, 0A.

CR, Carriage Return has the hex value, 0D.

 

You can use the special built in function, ng:hexToUtf8() to define a variable e.g. $LineFeed as either LF or CR or both.

 

If you want to insert CRLF you can change the assignment of the variable above to this:

ng:hexToUtf8('0D0A')

 

like so:

 

NG2BarcodeLineBreaks0002

 

Please notice, that the output is not shown correctly in the result view, so you need to do a preview to see the final, correct result.

 

The result view might look like this (if you output as a text):

 

NG2BarcodeLineBreaks0003

But the preview and final result looks like this:

 

NG2BarcodeLineBreaks0004

    • Related Articles

    • Barcode element

      To insert a barcode in InterFormNG2 you need to click this icon: You can find it via the '+' here: You can edit an existing barcode element by double clicking the barcode element in either the element tree on the left or in the result view of the ...
    • Change page breaks of a spooled file

      When you merge an input spooled file with a template in InterFormNG2 e.g. for PDF or print output, then you normally want the same page breaks in the output as in the original input spooled file. You are however not necessarily limited by that and ...
    • Insert any hex character in a 2D barcode

      In some 2D barcodes it is required to insert very special characters, that you cannot find on your keyboard. The characters are normally specified as the ascii hex character. These special characters are e.g. used as delimiters in 2D barcodes to ...
    • Line element

      If you want to insert a line in a template, then you need to click the line element icon: After you have clicked the line element, the pointer icon changes to a cross hair icon indicating, that InterFormNG2 now expects you to start and end position ...
    • Line break element

      The line break element can only be inserted in a container (or page element), which has a horizontal flow direction (row). The line break element is found here in the list of elements in the designer: If you insert this then the following text is ...