更新记录

1.0.4(2024-06-01)

页面组件事件名称调整。

1.0.3(2024-05-23)

修改页面组件调用名称为pdf-reader

1.0.2(2024-05-20)

修复iOS事件参数问题。

查看更多

平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.7.0,Android:4.4,iOS:11 × × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × × × × × ×

概述

XF-pdfReaderUTS封装了本地或者网络PDF预览功能。

模块调用

<pdf-reader ref="pdfReader" :hidden="hidden"
    :style="{width:widthNum+'rpx',height:heightNum+'px',background:yanse}" @tap="onTap"
    @pagechanged="onPageChanged" @pagecategory="onPageCategory">
</pdf-reader>

模块接口

openFile

打开指定的pdf文件

openFile(path : string)

示例代码

this.$refs["pdfReader"].openFile("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

openFileByPage

打开指定的pdf文件

openFileByPage(path : string, defaultPage : number)

示例代码

this.$refs["pdfReader"].openFileByPage("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

openFileByPageAndDirection

打开指定的pdf文件

openFileByPageAndDirection(path : string, defaultPage : number, swipeHorizontal : boolean)

示例代码

this.$refs["pdfReader"].openFileByPageAndDirection("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

openFilePassword

打开指定的pdf文件

openFilePassword(path : string, password : string)

示例代码

this.$refs["pdfReader"].openFilePassword("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

openFilePasswordByPage

打开指定的pdf文件

openFilePasswordByPage(path : string, password : string, defaultPage : number)

示例代码

this.$refs["pdfReader"].openFilePasswordByPage("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

openFilePasswordByPageAndDirection

打开指定的pdf文件

openFilePasswordByPageAndDirection(path : string, password : string, defaultPage : number, swipeHorizontal : boolean)

示例代码

this.$refs["pdfReader"].openFilePasswordByPageAndDirection("/static/XF-appGray.pdf");

可用性

iOS、Android系统

可提供的1.0.0及更高版本

getPageSize

获取PDF的总数页

getPageSize()

示例代码

this.$refs["svgaPlayer"].getPageSize();

可用性

iOS、Android系统

可提供的1.0.0及更高版本

getCategory

获取PDF的目录

getCategory()

示例代码

this.$refs["svgaPlayer"].getCategory();

可用性

Android系统

可提供的1.0.0及更高版本

jumpTo

设置要跳转的页数

jumpTo(page : number)

示例代码

this.$refs["svgaPlayer"].jumpTo(1);

可用性

iOS、Android系统

可提供的1.0.0及更高版本

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问