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

PDF Form Barcode Generator Variable Order

New Here ,
Oct 26, 2018 Oct 26, 2018

I haven't been able to find how to format the Barcode so the order of the variables is correct. It seems to randomly generate an order of variables in Tab delimited format, with no seeming way to change that order so the barcode would work with other programs inputs

TOPICS
PDF forms
989
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 ,
Oct 29, 2018 Oct 29, 2018
LATEST

The way this code is written, it goes through all the fields, checking each one against your list. The list isn't used to order them. You need to recode it. Similarly, if you want a tab at the end, you need to change your code.

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
Community Expert ,
Oct 26, 2018 Oct 26, 2018

You can edit the underlying code and change the order of the fields in the array.

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 ,
Oct 29, 2018 Oct 29, 2018

I used the code below and adjusted the order of ["WO LOT Number", "Part Number", "Quantity",  ]

The actual output was tab delimated "Part Number", Quantity", "WO LOT Number" also I would like a tab at the end, and that didn't occur too.


/* 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: ["WO LOT Number", "Part Number", "Quantity", ], bFieldNames: false});

    else event.value = " ";

}

catch (e)

{

    event.value = " ";

}

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 ,
Oct 29, 2018 Oct 29, 2018
LATEST

The way this code is written, it goes through all the fields, checking each one against your list. The list isn't used to order them. You need to recode it. Similarly, if you want a tab at the end, you need to change your code.

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