Header Ads

How to implement MUPDF Library to your project in 1 second :)


Today i will show you how to using MUPDF 1.7 as a library . . . . with easiest way !!!

tool
Android Studio 1.2.2
Mupdf version 1.7
link mupdf : http://mupdf.com/doc/overview
link play store : https://play.google.com/store/apps/details?id=com.artifex.mupdfdemo


1. Create a new project with blank  Activity or in your exist Project
2. Add module "Mupdf" in your project and add module as library
3. Copy file pdf in your device
I use path : storage/emulated/0/Document/bookname.pdf

in your MainActivity code


Intent intent = new Intent(MainActivity.this,com.artifex.mupdfdemo.MuPDFActivity.class);
intent.setAction(Intent.ACTION_VIEW);
String bookPath = Environment.getExternalStorageDirectory().toString() + "/Document/bookname.pdf";
intent.setData(Uri.parse(bookPath));
//set true value for horizontal page scrolling, false value for vertical page scrollingintent.putExtra("horizontalscrolling", true);
startActivity(intent);

Link module
https://drive.google.com/file/d/0BwDf1R2iXx6OUjd0TDNQOTBsZmc/view?usp=sharing

No comments:

Powered by Blogger.