Git Product home page Git Product logo

jameschou51 / androidwebviewpdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from g707175425/androidwebviewpdf

0.0 1.0 0.0 1.83 MB

修改并集成pdf.js使Android WebView支持浏览pdf,jpg,png格式,相比mupdf更为简单且轻量,只需要几行代码即可支持加载本地pdf(受制于pdf.js性能影响,如需加载大型pdf对显示速度有需求,请使用mupdf)

Java 76.90% HTML 23.10%

androidwebviewpdf's Introduction

AndroidWebViewPDF

此Demo集成pdf.js使Android WebView支持浏览pdf,jpg,png格式,相比mupdf更为简单且轻量,只需要几行代码即可支持加载本地pdf(受制于pdf.js性能影响,如需加载大型pdf对显示速度有需求,请使用mupdf)

预览效果

  预览效果

使用

xml中引入控件
<g707175425.pdflib.PdfWebView
    android:id="@+id/webview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
  //使用此方法打开指定路径
  webview.loadFilePath(path);

混淆

由于用到了js和java桥 需要proguard-project.txt 或者 proguard-rules.pro中加入如下配置:

-keep class cn.schope.lightning.activity.PdfViewerActivity.WebViewBridge.**{*;}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.