GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - herohql/pdf-master: vue功能最全的pdf组件,支持渲染、页码提取与跳转、文件加载完成监听、页面变化监听、文本搜索、关键词高亮、目录提取

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
examples
examples
 
 
lib
lib
 
 
public
public
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
README.md
README.md
 
 
babel.config.js
babel.config.js
 
 
jsconfig.json
jsconfig.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
vue.config.js
vue.config.js
 
 

Repository files navigation

pdf-masterv.js

由Mozilla PDF提供的核心功能支持的Vue组件,使用Vue2语言开发。

演示

DEMO

功能

  • 支持PDF全部文档加载
  • 支持PDF单页加载,通过页码翻页
  • 支持适配容器大小和自定义缩放
  • 支持只读模式(无法复制)
  • 支持文档搜索功能
  • 支持关键词全部高亮
  • 支持指定页码跳转及页码变换监听
  • 支持文档加载完成监听
  • 支持目录提取

安装

npm install pdf-masterv

使用

全局注册

//main.js 
import pdfMasterv from 'pdf-masterv'
import 'pdf-masterv/lib/pdf-masterv.css'
Vue.use(pdfMasterv)

局部注册

import pdfComponent from 'pdf-masterv'
import 'pdf-masterv/lib/pdf-masterv.css'
export default {
  components:{pdfComponent}
}
  <pdfComponent ref="pdf" url='http://xxx/test.pdf' scale="1" :textMode="1" :singlePage="false"></pdfComponent>

文档

Attributes

参数 说明 类型 可选值 默认值
url pdf地址 string — —
scale 设置缩放 string |number 'auto': 自动缩放到适合容器的大小。
'page-fit': 缩放到页面适合容器的大小。
'page-width': 缩放到页面宽度适合容器的大小。
1
textMode 文本模式,可以设置只读模式0(不能复制),1显示文本层(可复制) number 0/1 1
singlePage 单页模式,接收布尔值,控制显示pdf的单页显示,false则显示所有页面 boolean false

Methods

方法名 说明 参数
loaded 监听pdf加载完成的回调,接收参数state:{numPages,curPageNum} 总页数、当前页码 Function(callback: Function(state))
pageChange 监听pdf页码变化,参数state:{numPages,curPageNum} 总页数、当前页码。包括滚动条页面浏览,单页模式跳转均可监听变化。 Function(callback: Function(state))
pdfFindAgain 实例方法,短语逐个查找 keyword
pdfFindAll 实例方法,高亮所有查找的短语 keyword
getOutLine 实例方法,获取pdf目录,返回outline {title:'章节名称',pageNumber:'所在pdf中的页码'} Function(outline))
pageGo 实例方法,跳转指定页码。this.$refs.pdf.pageGo(num) number

联系作者

img

About

vue功能最全的pdf组件,支持渲染、页码提取与跳转、文件加载完成监听、页面变化监听、文本搜索、关键词高亮、目录提取

herohql.github.io/pdf-master/dist/index.html

Topics

pdfpdf-directorypdf-highlightpdf-searchvue

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.