How to render a PDF file in Android

后端 未结 9 948
猫巷女王i
猫巷女王i 2020-11-22 02:09

Android does not have PDF support in its libraries. Is there any way to render PDF files in the Android applications?

9条回答
  •  悲哀的现实
    2020-11-22 02:24

    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();
    

提交回复
热议问题