Skip to main content
Participant
November 14, 2016
Answered

Encoding numbers into QR code

  • November 14, 2016
  • 1 reply
  • 1216 views

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

This topic has been closed for replies.
Correct answer George_Johnson

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;

1 reply

Inspiring
November 14, 2016

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.

Participant
November 15, 2016

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?

George_JohnsonCorrect answer
Inspiring
November 15, 2016

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;