LiveCycle dynamic PDF - how to enforce Acrobat version?

133 views Asked by At

I have a dynamic PDF that doesn't display correctly in Firefox, Chrome, or lower versions of Adobe. Is there a way to show blank page with error message when the user opens it with anything less than Acrobat version X? I tried searching on this site and Googling but couldn't find anything.. Help much appreciated!!

1

There are 1 answers

0
GuillaumeCleme On

This can be achieved with a PDF cover page but can also be achieved with your own subform combo and a bit of script. Creating a cover page that is hidden only to reveal your form content if a script executes correctly and is inside a full feature XFA form viewer is one way to tackle this.

function detect(){

    //Sample platform detection
    var viewerType = xfa.host.appType;
    var versionNo = xfa.host.version;
    var variation = xfa.host.variation;
    var plugIns = app.plugIns;
    var nplugIns = plugIns.length;
    var msg = "";

    if((viewerType == "Reader") && (nplugIns > 0)){
        msg = "This PDF was opened in Reader " + versionNo + ", " + variation + ", and loaded " + nplugIns + " plug-ins.";
        form1.Top.Cover.presence = "hidden";
        form1.Top.Content.presence = "visible";     
    }
    else if((viewerType == "Exchange") && (nplugIns > 0)){
        msg = "This PDF was opened in Acrobat " + versionNo + ", " + variation + ", and loaded " + nplugIns + " plug-ins.";
        form1.Top.Cover.presence = "hidden";
        form1.Top.Content.presence = "visible"; 
    }
    else if((viewerType == "Exchange-Pro") && (nplugIns > 0)){
        msg = "This PDF was opened in Acrobat Pro " + versionNo + ", " + variation + ", and loaded " + nplugIns + " plug-ins.";
        form1.Top.Cover.presence = "hidden";
        form1.Top.Content.presence = "visible"; 
    }
    else{
        msg = "This PDF was opened in an unrecognized platform";
    }

    xfa.host.messageBox(msg); //Throw prompt.
    form1.Top.Content.TextField1.rawValue = msg; //Write message to form.

}

Most of the function above relies on xfa.host.appType but some PDF viewers developped using the Adobe Acrobat code base will return valid platform values but will not load any plug-ins which is a way to detect and unsupported platform.