android studio pdf viewer Tutorial

android studio pdf viewer Tutorial, android studio pdf reader tutorial, pdf reader android app source code, how to create pdf viewer in android studio

Add to build.gradle:

implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'

Include PDFView in your layout

android:layout_height="match_parent" />

Load a PDF file

PDFView pdfView;

= findViewById(;



At Create Folder (assets ).Paste the PDF here...

Taking a deep look into the code above

filename is a place holder for the pdf file you uploaded. Input the name without the extension (.pdf)


This allows you to changing pages using swipe


Allows you to swipe left and right horizontally


This can be set to true if you want to render annotations such as colors, comments forms etc but in my case i disabled it by setting the value to false


As you might have thought of this determines the space in between pages measured in dp. To make it more obvious set view background which will make you see the spacing color