How to open PDF file in Ionic/Cordova app?

I am working on an ionic application and need to open a PDF in my Ionic app. I used the Document viewer plugin:

ionic Cordova plugin add Cordova-plugin-document-viewer
npm install @ionic-native/document-viewer

But the plugin is not working on any platform and giving errors.

While going through few blogs I found iframe to open the PDF which is using google docs to open my PDF in iframe. It is only working when I’m attaching my pdf link with google docs link like this:

pdfLink = this.sanitizer.bypassSecurityTrustResourceUrl('http://docs.google.com/gview?embedded=true&url='+ this.pdfURL);

Is this the correct way to open pdf or are there any consequences? Is there any way to not using google docs link to open pdf and I can directly open the pdf in Ionic app.

Source: New feed
Source Url How to open PDF file in Ionic/Cordova app?