This is the input field for the document to be uploaded <ion-item> <ion-input name='File' required type="file" (change)="getNoOfPages($event)"></ion-input> </ion-item> This is the function am calling after the file is selected, am using the string split method to find the type because 'type' does not always holds the file type info, can I use any js library to find the number of pages in uploaded document (pdf in this case) or do I have to use anything in specific to make it work on android ? and how ? getNoOfPages(event: any) { const fileInfo = event.target.files[0]; const type = fileInfo.name.split('.')[1]; console.log('document uploaded ', fileInfo); switch (type) { case 'docx': break; case 'pdf': console.log('this is a pdf file'); break; } } Continue reading...