用cordova打开本地pdf文件 [英] Open a local pdf file with cordova
问题描述
我使用cordova 3.3.0,我想打开一个本地pdf文件,然后根据用户需求关闭它。
Im using cordova 3.3.0 and i would like to open a local pdf file and then close it on user demand.
ref = window.open(encodeURI(path), '_blank', 'location=yes');
ref.addEventListener('exit', function() {
ref.removeEventListener('exit', function(){});
ref.close();
});
这会在inapp浏览器中打开一个文件,我不能回到实际的应用程序,当我打开一些pdf文件。如何添加一些关闭按钮或什么?
This opens a file in inapp browser but i cannot get back to the actual app when I open some pdf file. How to add some close button or something ?
我试图让这项工作在ios。
Im trying to get this working on ios.
推荐答案
很久以来,你问过这个问题,但刚刚有同样的问题。我不得不在我的项目上安装inAppBrowser插件,完成按钮出现。没有安装插件,pdf打开,但完成按钮没有显示。
Long time since you asked this but just had exactly the same issue. I had to install the inAppBrowser plugin on my project and the Done button appeared. Without the plugin installed, the pdf opened but the Done button was not shown.
这篇关于用cordova打开本地pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!