Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic how to open pdf file and see in device for both ios and android

I have one pdf url. When i try to open its working in browser. But when i try to open in both android and ios device. My pdf file is not opening to see. Here my code :

My Controller :

$window.OpenLink = function(link) {
    window.open( link, '_system');
  };

My html code on-click:

<div  class="col col-50 clsGrid" onclick="OpenLink('http://www.orimi.com/pdf-test.pdf')">

Please help me out. How can i open my pdf file and see in both android and ios device.

Thanks in advance !!

like image 401
hybrid Dev Avatar asked Apr 18 '17 11:04

hybrid Dev


1 Answers

install plugin

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git

then try this

<a class="item" href="#" onclick="window.open('http://www.orimi.com/pdf-test.pdf', '_system', 'location=yes'); return false;">
  Open pdf
                </a>
like image 162
Edison Avatar answered Oct 13 '22 01:10

Edison