社区微信群开通啦,扫一扫抢先加入社区官方微信群
社区微信群
github地址:https://github.com/qiushi123/AndroidPdfViewDowload
源码下载:http://download.csdn.net/detail/qiushi_1990/9579398
下面是效果图
OkHttpUtils.get(pdfUrl)//
.tag(this)//
.execute(new DownloadFileCallBack(Environment.getExternalStorageDirectory() +
"/temp", "qcl.pdf"));//保存到sd卡
pdfView.fromFile(file)
// .pages(0, 0, 0, 0, 0, 0) // 默认全部显示,pages属性可以过滤性显示
.defaultPage(1)//默认展示第一页
.onPageChange(this)//监听页面切换
.load();
3,简单的显示下布局
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.joanzapata.pdfview.PDFView
android:id="@+id/pdfView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="1/10"/>
</FrameLayout>
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!