Designer Output Creation additional barcode (DataMatrix)

Hi,

In Designer, I need to add an DataMatrix barcode that prints on the front side of each duplex sheet for each document. It needs to contain [Document number, Left padded with 0 to a length of 6] + [Document total pages, Left padded with 0 to a length of 2] + [Current document page, Left padded with 0 to a length of 2] .

I tried to set this up on the template, but I am very new to Designer, and wasnt able to get it working.

Currently, the method I am using is to use Output Creation’s ‘Additional Barcode’, where I have set up the text as follows.

${document.sequence.job}${document.count.pages}${page.nr}

  1. How do I make segment print padded and to the needed length as described above?

  2. What do I put as the condition to make this print only where the Mod of page.nr indicates the front of each sheet.

  3. Is there an easier way to do this?

Thank you very much for your help.

I have the solution for this in Output Creations Additional Barcode. You can do normal JavaScript as long as it is encapsulated in a ${}

Try Text as :

${var thisD = ‘000000’ + document.sequence.job; thisD.substring(thisD.length - 6, thisD.length);}${var thisC = ‘000000’ + document.count.pages; thisC.substring(thisC.length - 2, thisC.length);}${var thisP = ‘000000’ + page.nr; thisP.substring(thisP.length - 2, thisP.length);}

As Condition:

page.nr % 2 == 1

1 Like

Perhaps I am late to the party, but one could also use the _slice() _function which I prefer better in combination with the Ternary operator:

_var variableName_ = (_condition_) ? _value1 if condition returns TRUE_:_value2 if condition returns FALSE;_

${var x = '000000' + document.sequence.job; x.slice(-6);}${var y = (document.count.pages< 10) ? '0'+ document.count.pages:document.count.pages; y;}${var z = (page.nr < 10) ? '0'+ page.nr:page.nr;z;}

1 Like

Hello Rod,

Can you please help me with a solution for a datamatrix. I need to add a Datamatrix barcode in front of each duplex sheet for each sheet within the document. It needs to contain:

[sheet.sequence.document- left padded with 0 to a length of 1] + [document.count.sheets-left padded with 0 to a length of 1] +[number of document-right padded with 0 to a length of 3 & left padded with 0 to a length of 2]

This is an example of how it should look:
Datamatrix%20example

Thank you very much