cordova open pdf - fileOpener2

时间:2015-10-19 10:24:40

标签: javascript cordova pdf

我想用fileOpener2打开PDF文件

我的config.xml如下所示:

<feature name="FileOpener2">
    <param name="android-package"
        value="io.github.pwlin.cordova.plugins.fileopener2.FileOpener2" />
</feature>
<feature name="File Opener2">
    <param name="id" value="cordova-plugin-file-opener2" />
</feature>

我的HTML代码:

<SCRIPT language="JavaScript">

function callPDF() {
cordova.plugins.fileOpener2.open('/sdcard/Download/bericht74.pdf', 'application/pdf');
}

</SCRIPT>
</head>
    <body>
 <a href="#" onClick="callPDF()">
<strong>open pdf</strong></a>

Eclipse告诉我:

10-19 10:16:02.111: I/chromium(17201): [INFO:CONSOLE(18)] "Uncaught ReferenceError: cordova is not defined", source: file:///android_asset/www/index.html (18)

如何正确调用fileOpener2插件?

0 个答案:

没有答案