-1

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!!

Volfmann
  • 1
  • 1
  • That option should not be in your document but in the PDF reader that your users are using. (Which can be about anything, not just The Latest Acrobat.) You could think of adding a note on where your users download the file from, or (more user friendly) simply not use the advanced options that later PDF versions allow. – Jongware Jun 09 '15 at 22:15

1 Answers1

0

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.

GuillaumeCleme
  • 317
  • 1
  • 2
  • 10