android 查看看pdf,ppt,word文档,Android 文档查看: word、excel、ppt、pdf,使用 mupdf 及 tbs...

AndroidDocumentViewer

项目地址:hanlyjiang/AndroidDocumentViewer

简介: Android 文档查看: word、excel、ppt、pdf,使用 mupdf 及 tbs

更多:作者   提 Bug

标签:

示例 app 效果:

如何使用?

参考: 示例

复制lib_fileviewer模块,加入到 project

App 中 build.gradle 中加入以下配置: ndk {

// 此处必须设置为 armeabi ,TBS 文件浏览不支持其他类型

abiFilters "armeabi"

}

TBS 初始化(在 Application 中): QbSdk.initX5Environment(getApplicationContext(), new QbSdk.PreInitCallback() {

@Override

public void onCoreInitFinished() {

Log.d(TAG, "onCoreInitFinished");

}

@Override

public void onViewInitFinished(boolean initResult) {

Log.e(TAG, "onViewInitFinished" + initResult);

}

});

查看文件统一入口: Uri uri = Uri.fromFile(new File(filePath));

FileViewer.viewFile(context,uri)

直接使用 mupdf 查看: FileViewer.viewPDFWithMuPDFByPath(Context context, String filePath)

或: FileViewer.startMuPDFActivityByUri(Context context, Uri documentUri)

直接使用 TBS 查看 word 文档: TBSFileViewActivity.viewFile(context, filePath);

注意事项

office 文件无法查看(TBS 初始化失败),可以查看这个文档:无法加载 x5 内核的解决方案.doc

使用到的库:

PDF 查看: mupdf

版本: v1.11.1

介绍: MuPDF is an open source software framework for viewing and converting PDF, XPS, and E-book documents. There are viewers for various platforms, several command line tools, and a software library for building tools and applications.

项目地址: https://mupdf.com/docs/

Android 文档: https://mupdf.com/docs/android-sdk.html

word 等文件查看 : TBS(腾讯浏览服务)

简介: web 内核

官方页面

随手点击下面广告,支持我维护本站吧

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值