Here i am posting my code of selecting PDF from file manager. i need to get file path of selected PDF. how can i get it?
.html
<input type="file" (change)="selectPDF($event)" class="file-input upload-items" name='company_pdf' style="opacity: 0"
id="company_pdf" #fileInp>
.ts
selectPDF(fileInput: any) {
if (fileInput.target.files[0].type == 'application/pdf') {
console.log(fileInput.target.files)
this.PDFfiles.push(fileInput.target.files[0]);
if (this.PDFfiles.length > 4) {
this.disablePdfUplaod = true;
}
//this.PDFfile = fileInput.target.files[0];
} else {
this.shared.showToast('Please select PDF')
}
}
You can try Ionic FileOpener
the best approach would be Document Viewer
Document Viewer
This plugin offers a slim API to view PDF files which are either stored in the apps assets folder (/www/*) or in any other file system directory available via the cordova file plugin.
if u are choosing from file manager do some like this and open the pdf from my other answer
Here you can find both android and iOS platform answer. How to pick pdf document and view that document.
.html
.ts
Hope it will helps you.