2017-08-09 78 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