Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Encoding numbers into QR code

New Here ,
Nov 14, 2016 Nov 14, 2016

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

TOPICS
PDF forms
984
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
LEGEND ,
Nov 15, 2016 Nov 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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 14, 2016 Nov 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 15, 2016 Nov 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 15, 2016 Nov 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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 15, 2016 Nov 15, 2016
LATEST

Thanks a lot, that works perfectly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines