LiveCycle动态PDF - 如何强制执行A​​crobat版本?

时间:2015-06-09 21:44:40

标签: pdf compatibility livecycle

我有一个动态PDF,无法在Firefox,Chrome或较低版本的Adobe中正确显示。当用户使用少于Acrobat版本X的东西打开它时,有没有办法显示带有错误消息的空白页? 我尝试在这个网站上搜索和谷歌搜索,但无法找到任何东西.. 非常感谢!!

1 个答案:

答案 0 :(得分:0)

这可以使用PDF cover page来实现,但也可以使用自己的子表单组合和一些脚本来实现。如果脚本正确执行并且在完整功能XFA表单查看器中,则创建仅隐藏以显示表单内容的封面页是解决此问题的一种方法。

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.

}

上述大多数功能都依赖于 xfa.host.appType ,但使用Adobe Acrobat代码库开发的一些PDF查看器将返回有效的平台值,但不会加载任何插件,这是一种检测和不支持平台的方法。

相关问题