Step by step - Learn how to use callas productscallas pdfToolbox Place contentAdvanced applications for 2D codes (requires pdfToolbox 9.1)

Advanced applications for 2D codes (requires pdfToolbox 9.1)

pdfToolbox 9.1 offers a wide range of expanded functionality enabling the creation of barcodes and matrix codes for all conceivable industries and applications. This article shows some interesting potential example applications for creating barcodes and matrix codes with pdfToolbox.

Note: The following examples use a number of advanced functions which are not available through the “Place barcode” Fixup. They require the more powerful “Place dynamic content” Fixup as well as additional instructions in HTML and JavaScript.

Ready-made example Fixups in the pdfToolbox Library

Please load and import the following pdfToolbox Library:

The functions described below are based on Fixups which you will find after import in the relevant categories within pdfToolbox.

Example: Deutsche Post DP matrix codes

Deutsche Post’s 2D codes follow the very strict specification given below. They are based on data matrix codes which can be combined with a range of precise rules specified by Deutsche Post.

The example Fixup shown here creates two variants of the Deutsche Post DP matrix code at the upper left of each page in the currently open document.

The core of the user-defined HTML template uses the following code:

<object class="barcode_object"  type="application/barcode" > 
<param name="type" value="Data Matrix">
<param name="data" value="***insert data!***">
<param name="modulewidth" value="0.423mm">
<param name="dm_format" value="PostMatrix">
<!-- **empty string**, UCCEAN, Industry, _Macro05, Reader, PostMatrix -->
<param name="dm_size" value="22x22">
<!-- **empty string**, 10x10, 12x12, 14x14, 16x16, 18x18, 
20x20, 22x22, 24x24, 26x26, 32x32, 36x36, 40x40, 
44x44, 48x48, 52x52, 64x64, 72x72, 80x80, 88x88, 
96x96, 104x104, 120x120, 132x132, 144x144, 8x18, 
8x32, 12x26, 12x36, 16x36, 16x48-->
<param name="dm_enforcebinaryencoding" value="false">
<!-- **false**, true-->
<param name="dm_rectangular" value="false">
<!-- **false**, true-->
</object>

If this code is given suitable CSS styling, a Deutsche Post DP matrix code will be placed at the upper left of each page in the current open document:

Example: Data matrix Industry 2D Code in 16x48

A wide range of data matrix codes exists depending on the industry in which they are used. Certain industries use a rectangular “Industry” sub-type as a data matrix code instead of a square one.

The example Fixup shown here creates a version with 16x48 cells which is placed at the bottom left of each page in the current open document.

The core of the user-defined HTML template uses the following code:

<object class="barcode_object"  type="application/barcode" > 
<param name="type" value="Data Matrix">
<param name="data" value="Actual data"> <!-- <<== Actual data must go here -->
<param name="modulewidth" value="0.25577mm"> 
<param name="dm_format" value="Industry">
<param name="dm_rectangular" value="true">
<param name="dm_size" value="16x48">
<!-- 
<param name="dm_size" value="16x48">
supported values:
**empty string**, 10x10, 12x12, 14x14, 16x16, 18x18, 20x20, 22x22, 24x24, 
26x26, 32x32, 36x36, 40x40, 44x44, 48x48, 52x52, 64x64, 72x72, 80x80, 88x88, 
96x96, 104x104, 120x120, 132x132, 144x144, 8x18, 8x32, 12x26, 12x36, 16x36, 16x48
-->
</object>

If this code is given suitable CSS styling, a 16x48 data matrix code will be placed at the bottom left of each page in the current open document:

Example: Rainbow-colored QR code containing your name

QR codes can be used for a wide range of purposes. This example shows a design which would not be permissible in many industries due to their strict readability requirements. However, it may be of interest in more creative sectors. It is important to make clear that these codes do not comply with any ISO standard in any way. However, they scan surprisingly well on current smartphones or with modern 2D code readers.

Note: The technology shown here can also be applied to other types of barcode or matrix code.

The following example Fixup produces a rainbow-colored QR code with a name that can be entered when the Fixup is run.

The core of the user-defined HTML template uses the following code:

<object id="barcode_object"type="application/barcode" 
style = "color: #eee;color: -cchip-cmyk(0,0,0,0.1);
background-color: pink; 
background: linear-gradient(135deg, firebrick, red, orange, orange, green, blue, indigo, violet); "  
> 
<param name="type" value="QR-Code">
<param name="modulewidth" value="1mm">
<param name="data" id="id_barcodevalue" value="fill in actual value<param name="swap_foreground_background" value="true">
<param name="quietzoneleft" value="1">
<param name="quietzoneright" value="1">
<param name="quietzonetop" value="1">
<param name="quietzonebottom" value="1">
<param name="quietzoneunit" value="X">
</object>

0 Comments

Send Your Comment

E-Mail me when someone replies to this comment