Copy link to clipboard
Copied
Hi all,
I have put a QR code item from the form tools, in which I encode several fields of my doc.
When I try to input phone numbers (with a leading 0), it seems alright but the decoded data has no longer that leading 0.
Same with a long string of numbers, which seems to be encoded as for instance 1.6584412e21 instead of the exact reference I need.
Can anyone explain what I should do to retrieve the full data I need?
That would help me a lot.
Cheers,
Aurélien
Copy link to clipboard
Copied
After you set up your barcode field, go to the Value tab of the field properties window and select the "Custom Calculation Script" option. Click the Edit button and replace this line of code:
strValues += oParam.oDoc.getField(strFieldName).value;
with this:
strValues += oParam.oDoc.getField(strFieldName).valueAsString;
Copy link to clipboard
Copied
You need to make and access values for which you want to retain leading zeros as strings not numbers. Floating point format, used by Acrobat and Reader does not retain leading zeros.
Copy link to clipboard
Copied
Thank you for your answer.
Actually I had come to that conclusion already but I cannot figure out how to create those fields as strings.
Any hints?
Copy link to clipboard
Copied
After you set up your barcode field, go to the Value tab of the field properties window and select the "Custom Calculation Script" option. Click the Edit button and replace this line of code:
strValues += oParam.oDoc.getField(strFieldName).value;
with this:
strValues += oParam.oDoc.getField(strFieldName).valueAsString;
Copy link to clipboard
Copied
Thanks a lot, that works perfectly.

