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

How to format an acrobat standard QR code in Vcard?

New Here ,
Nov 01, 2018 Nov 01, 2018

Copy link to clipboard

Copied

Hi,

I'm working on a QR code, I've selected some text fields (NAME, TITLE, PHONE, EMAIL, URL), inserted a QR code and it works but it doesn't create the Vcard format I need (when I scan the QR my cellphone doesn't recognise it as a contact that I could easily save in my phone clicking on "add to contact".

So my problem is that I would like the QR code to be a Vcard but when I try to modify the script (with the custom calculation script option) this appears and at this point I get lost:

---------------------------------------------------------------------------------------

/* 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: ["NAME", "TITLE", "PHONE", "EMAIL", "URL"], bFieldNames: false});

    else event.value = " ";

}

catch (e)

{

    event.value = " ";

}

---------------------------------------------------------------------------------------

Could someone help me to modify this script to get a Vcard ?

Thanks in advance !

TOPICS
Acrobat SDK and JavaScript , Windows

Views

254

Likes

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
no replies

Have something to add?

Join the conversation