Skip to Content
0
Aug 30, 2023 at 03:02 AM

Add leading zero to value using script in Adobe form

195 Views Last edit Aug 30, 2023 at 03:19 AM 4 rev

My requirement is print the barcode with page number and other field values , the page number length should be 2 digits ( ex: 00,01,02..etc) , i added the below logic for page number , i see page number is printing without leading zero , so i added the below code to concatenate the leading zero , but its not working , please review the code and let me know for the correction.

var pagen = xfa.layout.page(Ref($));

var flen = string(pagen).length;

if (flen=1)

{

this.rawValue = concat("0", pagen , "01" , counter)

else

this.rawValue = concat(pagen , "01" , counter)

}