Giter Club home page Giter Club logo

openpdf's Introduction

#ionic打开pdf的插件(android) 内置pdf查看器

这个插件内置了pdf查看器,不是调用机器自带的pdf阅读软件打开,而是在app内部查看pdf。因为是项目需要,我只做了打开远程pdf文件url的功能,没做本地打开pdf,但是看源码的话应该很好改,大家可以按照自己的需求修改代码。

首先需要在android项目的gradle中添加

compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'

##调用方法

 window.plugins.OpenPDF.openWithUrl($scope.pdfUrl,function(data){
  console.log('success data:'+data);
},function(data){
  console.log('error data:'+data);
});

只有一个参数,就是pdf的远程url地址,这个做了一个缓存,他在第一次打开url的时候,会先下载该pdf文件到本地,之后在调用该方法传入该地址,就只打开本地的pdf,不会再去服务器下载该pdf文件了。

欢迎反馈bug

openpdf's People

Contributors

longzhiwuing avatar

Watchers

James Cloos avatar Yu Xiangyang avatar

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.