Show PDF file in App

后端 未结 3 1387
日久生厌
日久生厌 2021-02-03 12:03

I found this two possibilities to show a pdf file.

  1. Open a webView with:

    webView.loadUrl(\"https://docs.google.com/gview?embedded=true&url=\"+

3条回答
  •  一整个雨季
    2021-02-03 12:26

    Many libraries are available for showing pdfs within your own app.

    • Android PDF Viewer
    • VuDroid
    • APDFViewer
    • droidreader
    • android-pdf
    • mupdf
    • android-pdfView

    For a working example using android-pdfView, see this blog post. It demonstrates the basic usage of the library to display pdf onto the view with vertical and horizontal swipe.

    pdfView = (PDFView) findViewById(R.id.pdfView);
    pdfView.fromFile(new File("/storage/sdcard0/Download/pdf.pdf")).defaultPage(1).enableSwipe(true).onPageChange(this).load();
    

提交回复
热议问题