Skip to main content
Participant
November 9, 2016
Question

When using a Barcode field, is it possible to Encode using something other than XML or TAB delimited? Our scanning software does not support XML or TAB delimited.

  • November 9, 2016
  • 1 reply
  • 989 views

We are bulding PDF forms which encode the form field values into a Barcode field. However, our scanning/OCR software does not support XML or TAB delimted in order to parse the field data. Ideally, we would like to use a "pipe" " | " character as the delimiter. Is there any way to accomplish this with a plug-in? Any suggestions would be greatly appreciated!

This topic has been closed for replies.

1 reply

Inspiring
November 9, 2016

You can use a custom calculation JavaScript to output to whatever format you want. If you start with Tab delimited and switch to the custom JavaScript option, you will be provided most of the code. You'd just need to replace the delimiter character.

Participant
November 9, 2016

Excellent. Thanks for the response. Here is the custom Java code from the current Barcode field. Any suggestions as to how to change the delimiter to a Pipe " |" ?

/* 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: ["Applicant Name", "City", "Date of Application", "Position 1", "Position 2", "Position 3", "Posting Number", "Print & Clear Form", "Substitute"], bFieldNames: false});

    else event.value = " ";

}

catch (e)

{

    event.value = " ";

}

Inspiring
November 9, 2016

Try replacing:

                strNames += "\t";

                strValues += "\t";

with:

                strNames += "|";

                strValues += "|";