How to open a remote PDF with Ionic?

Hi all,
I’d like to open a PDF (or just download it) from an Ionic App (Cordova 1.5.0 - Ionic CLI 3.6.0).
I’ve found many posts on that argument but I can’t find a nice solution.

I’ve tried:

this.iab.create(pdfUrl, "_self", "location=yes,hidden=no");
this.iab.create(pdfUrl, "_blank", "location=yes,hidden=no");, '_self', 'location=yes');, '_blank', 'location=yes');, '_system', 'location=yes');

The first 4 commands do not work, don’t open the PDF.
The last command downloads the file but opens the system browser on a page (I suppose the last visited) that has nothing to do with the wsUrl and the effect is not professional.

So, the question is always the same, is it possible to open a PDF with Ionic?

Thank you very much.


You need to install a pdf viewer for Angular 2 (4). First hit on my Google search was this:

But I’ve never used it. “Angular 2 npm pdf” is the search term you probably want. Probably your best bet is to try out a fe different libraries until you find something you like.

1 Like

Try this.


Yes this solution works well.
Thank you very much.

Thanks for the solution, I tried your method, its working fine in browser but not mobile device. what might be the issue?

Hi @AaronSterling thank you for your suggestion, I’ve tried to use this library but I’m not able to make it work.
I’ve not found examples on how to use it on Ionic3.

So I used the “iframe method” suggested by @ravi_sojitra.

However I’ll try again to use ng2-pdf-viewer because I think it could be a good solution.


Hi sir i used above solution but it is working in only local case after generating the build pdf content is not loaded in our HTM

Do you see any error on the Chrome console? There could be Cors issues.

No sir, not found any error in console.actually HTML doc is not created in element section but in the local HTML doc is created in which pdf data is show.i do understand sir why element is not you know sir what is the reason behind that.