you can use a simple method by import
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
and the XML code is
and just declare and add a file to an asset folder and just assign the name
PDFView pdfView=findViewById(R.id.pdfv);
pdfView.fromAsset("agl.pdf").load();