# sunsetglow-vue-pdf-viewer
**Repository Path**: lasereset/sunsetglow-vue-pdf-viewer
## Basic Information
- **Project Name**: sunsetglow-vue-pdf-viewer
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: feat/Annotation
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-06-09
- **Last Updated**: 2025-06-09
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# @sunsetglow/vue-pdf-viewer
用来预览 pdf 文件,开箱即用,无需多余的开发,操作简单,支持 vue3 vite,
## installation
```
pnpm i @sunsetglow/vue-pdf-viewer
yarn add @sunsetglow/vue-pdf-viewer
npm i @sunsetglow/vue-pdf-viewer
```
## 🎊 功能介绍
- 支持搜索,文本复制,自定义水印,打印,下载,缩放,左侧导航,分页等功能
- pdf 渲染采用虚拟列表,可以使你轻松展示大文件 pdf
## ⭐ demo

## 🌰 example
```vue
```
## 参数说明
| 参数名称 | 内容 说明 |
| ----------: | -------------------------------------------------- |
| loadFileUrl | pdf 文件路径 or ArrayBuffer or Uint8Array(必选) |
| pdfPath | pdf.js 里所需的 pdf.worker.min.js 指向地址(必选) |
| pdfOption | pdf 的配置选项 (可选) |
| loading | pdf 加载完成执行函数 (可选) |
## api 事件说明
- 对外开放 api 通一在 configPdfApiOptions 对象上
```ts
import { configPdfApiOptions } from "@sunsetglow/vue-pdf-viewer";
/**
* 控制pdf 跳到指定页码
* @param index
* 类型 number
*/
configPdfApiOptions.handleChange(1);
/**
* 搜索内置函数(在loading 函数里调用)
* @param keyword 搜索内容
* @param visible 是否展示搜索框 true
*/
configPdfApiOptions.onSearch("产品力成为推动其发展", false);
```
## 🎆 欢迎大家的使用
- 如果帮助到你,帮忙点个 star ,有任何改进可直接提 issue 或者私信邮箱 wyaoting999@163.com
- github 仓库地址 [sunsetglow-vue-pdf-viewer](https://github.com/wyaoting/sunsetglow-vue-pdf-viewer)
## 🌹🌹 致谢
- 此库基于 [pdf.js](https://github.com/mozilla/pdf.js) 进行二次封装感谢大佬的开源贡献精神