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

How to set a QR code values in specific order in PDF form

Community Beginner ,
Oct 28, 2023 Oct 28, 2023

Copy link to clipboard

Copied

I've created a PDF fillable form with Adobe Acrobat Pro DC and I added a QR code to it. The question is how to get a specific order of the QR code values when it is scanned?
I explain :
I have created a pdf invoice file, with QR code, that contains the following fields: text1, price1, qty1, texte2, price2, qty2, total.
I want the result be exactly in this order when I scann the QR code.
But the problem is when I scan it, I get this as a result: price1, price2, qty1, qty2, text1, texte2, total.
Please, someone know how to fix this issue?
TOPICS
PDF forms

Views

273

Translate

Translate

Report

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
Community Expert ,
Oct 29, 2023 Oct 29, 2023

Copy link to clipboard

Copied

Change the field names or change the field order at "Custom calculation script".

Votes

Translate

Translate

Report

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
Community Beginner ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

Thank you Bernd for the hint,

Please, could you share the "Custom calculation script" that I should put to get the result wanted?

Votes

Translate

Translate

Report

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
Community Expert ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

Activate the entry "Custom calculation script" and you will see the script.

Votes

Translate

Translate

Report

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
Community Beginner ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

I did, but even when I place the fields in the order that I want the result doesn't changed.

here is the script:

/* Customize: */
function bMemberOf(strName, aStrNames)
{
    for (var nMembIdx in aStrNames)
    {
        if (strName == aStrNames[nMembIdx])
            return true;
    }
    return false;
}

function strTabDelimited(oParam)
{
    var bNeedTab = false;
    var strNames = "";
    var strValues = "";
    for (var i = 0; i < oParam.oDoc.numFields; ++i)
    {
        var strFieldName = oParam.oDoc.getNthFieldName(i);
        if ((null == oParam.aFields || bMemberOf(strFieldName, oParam.aFields))
            && (null == oParam.strXclField || strFieldName != oParam.strXclField)
            && (oParam.oDoc.getField(strFieldName).type != "button"))
        {
            if (bNeedTab)
            {
                if (oParam.bFieldNames)
                    strNames += "\t";
                strValues += "\t";
            }
            if (oParam.bFieldNames)
                strNames += strFieldName;
            strValues += oParam.oDoc.getField(strFieldName).value;
            bNeedTab = true;
        }
    }
    if (oParam.bFieldNames)
        return strNames + "\n" + strValues;
    else
        return strValues;
}

try
{
    if ( app.viewerVersion >= ADBE.PMD_Need_Version )
        event.value = strTabDelimited({oDoc: this, aFields: ["Text1", "Price1", "Qty1", "Text2", "Price2", "Qty2", "Text3", "Price3", "Qty3", "Total"], bFieldNames: true});
    else event.value = " ";
}
catch (e)
{
    event.value = " ";
}

 

Votes

Translate

Translate

Report

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
Community Expert ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

The script ignores the order in the array.

You must change the script.

Votes

Translate

Translate

Report

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 30, 2023 Nov 30, 2023

Copy link to clipboard

Copied

LATEST

Hi, I was having the same issue. it seems like the order the data fields are outputted is done alphabetically with an odd way of treat capitalised field names (A>Z>a>z) I found prefixing my field names with A_, B_ meant that I could get them outputted in the order I want without having to teach myself JAVA 

Votes

Translate

Translate

Report

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