Customizing Character Printing in Advanced PDF

Print Last Characters:

To print a specific number of characters from the end of a field, you can use the following FreeMarker expression in your Advanced PDF template:

${record.checknum?string[record.checknum?length-4..]}

In this expression, record.checknum is the field from which you want to extract characters. Adjust the number ‘4’ to your desired count to print a different number of characters from the end.

Print Starting Characters:

To print a specific number of characters from the beginning of a field, use the following FreeMarker expression:

${record.checknum?string[0..3]}

Here, the range [0..3] specifies the characters from index 0 to 3 (inclusive), representing the first four characters of the checknum field. Adjust the range as needed to print a different number of characters from the start.

Eg :

Suppose record.checknum contains the value “1234567890”. By using the provided expressions, you can print “7890” for the last four characters and “1234” for the first four characters, respectively.

Leave a comment

Your email address will not be published. Required fields are marked *