Opening pdf file issue with InAppBrowser


#1

Hi. I try to open a pdf file using InappBrwoser plugin. I use below code :smile:

    $cordovaInAppBrowser.open('http://xxxx/try.pdf, '_system', options)
     .then(function (event) {
         alert("success");
     })
     .catch(function (event) {
         alert("error");
     });

When I use this code, it downloads file. If I change “_system” to “_blank”, it open a new window, but nothing will happen. How can I open a pdf file in app?
Thanks in advance.


#2

+1
did you find a solution ?


#3

On an IOS device it will just open the PDF.

However on Android you will need a PDF reader installed or use Mozilla PDF.js, either remotely or on device.


#4

@ordekci thanks, me help, but is correct is
$cordovaInAppBrowser.open(‘http://xxxx/try.pdf’, ‘_system’, options)