2017-08-09 80 views
1

我正在尝试集成radaeepdf科尔多瓦插件。我尝试了默认的cordova设置。radaeepdf科尔多瓦插件与Ionic2集成

Pdf从www /文件夹打开。但它不是从SD卡/下载打开。它显示无效的路径。

有没有人成功地将这个插件插入到android并从SD卡读取文件。

请尽可能帮忙。

EDIT-1 ::

`ngAfterViewInit(){ 

    setTimeout(() => { 
     console.log(this._file.externalRootDirectory); 

     RadaeePDFPlugin.open(
      { 
       url: "file:///storage/emulated/0/"+"Download/test.PDF", 
       password: "", //password if needed 
       readOnlyMode: false, 
       gotoPage: 2 
      }, 
      function(message) { 
       alert("Success: " + message); 
      }, 
      function(err){ 
       alert("Failure: " + err); 
      } 
    ); 

    },5000)` 
+0

你可以分享你的实现的代码吗? – Sampath

+0

@Sampath,请参阅编辑。该插件不接受SD卡路径。 – raju

回答

0

看来你的路径是wrong.Please尝试一下,如下图所示。

url: "file:///mnt/sdcard/Download/Test.pdf", //in case of pdf is in the device file system 

请参阅doc here

+0

它没有工作,它仍然给错误:打开失败的访问被拒绝或无效的路径 – raju

+0

可能你需要给予'密码:“”/ /密码如果需要的话呢? – Sampath

+0

文件中没有密码。 – raju