使用Android-Pdf-Viewer-Library开源框架
2016-02-05 21:22
375 查看
下面的框架是Android-Pdf-Viewer-Library这个开源框架的使用方法,在github中找到的,是一些比较简单的英语,应该可以看懂。
This is a packaging of the project "Android PDF Viewer" (http://andpdf.sourceforge.net/) into a reusable library to make PDF viewing easier from within your Android application. Consistent with the Android PDF Viewer project, the licensing for the PdfViewer project is LGPL Quickstart incorporating a PDF viewing activity into your project: 1) Add PdfViewer.jar into your project's build path 2) Copy the following drawable resources from PdfViewer/res/drawable into YourProject/res/drawable left_arrow.png right_arrow.png zoom_in.png zoom_out.png 3) Copy the following layout resources from PdfViewer/res/layout into YourProject/res/layout dialog_pagenumber.xml pdf_file_password.xml 4) Derive your PDF activity from net.sf.andpdf.pdfviewer.PdfViewerActivity 5) Using the default drawables and layouts: public int getPreviousPageImageResource() { return R.drawable.left_arrow; } public int getNextPageImageResource() { return R.drawable.right_arrow; } public int getZoomInImageResource() { return R.drawable.zoom_in; } public int getZoomOutImageResource() { return R.drawable.zoom_out; } public int getPdfPasswordLayoutResource() { return R.layout.pdf_file_password; } public int getPdfPageNumberResource() { return R.layout.dialog_pagenumber; } public int getPdfPasswordEditField() { return R.id.etPassword; } public int getPdfPasswordOkButton() { return R.id.btOK; } public int getPdfPasswordExitButton() { return R.id.btExit; } public int getPdfPageNumberEditField() { return R.id.pagenum_edit; } 6) Invoke your PdfViewActivity derived with the following code: Intent intent = new Intent(this, YourPdfViewerActivity.class); intent.putExtra(PdfViewerActivity.EXTRA_PDFFILENAME, "PATH TO PDF GOES HERE"); startActivity(intent);
相关文章推荐
- android 加载大图片适配问题解决方案
- Android开发之TextView高级应用
- Android Studio之提高编译的效率
- Android Material Design 详解(使用support v7兼容5.0以下系统(部分功能))
- Android 第九天(晚上)
- Android 框架练成 教你打造高效的图片加载框架 (转)
- Android SurfaceView实战 打造抽奖转盘 (转)
- Android M新的运行时权限开发者需要知道的一切
- Error:Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory Android
- Android Touch 事件传递机制
- 深入理解Android的startservice和bindservice
- android如何让service不被杀死
- android4.0手机访问某些网页提示证书过期或者证书不符的处理办法
- android适配
- Android 内存泄漏总结
- Android开发学习——Day1 Android开发环境配置
- Android 外存数据的读写
- android 选择图片以及拍照,保存图片
- Android图片异步加载
- Android 开源框架ActionBarSherlock