npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pdf-masterv

v0.1.2

Published

pdf for vue

Downloads

17

Readme

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

打赏50及以上可向作者索要源码(仅限自己项目使用,不能开源)

打赏的朋友欢迎添加微信,交流遇到的问题。

img