Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
You can edit the underlying code and change the order of the fields in the array.
Copy link to clipboard
Copied
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 = " ";
}
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now