运行demo
npm run start
打包
npm run build
使用
import PdfViewer from 'pdf-view-react';
import 'pdf-view-react/es/index.css';
import * as mem from 'mpdf.js';
<PdfViewer file={'https://cmimg.maycur.com/front-static-resource/test/multiple-page.pdf'} mem={mem} canDownload={true} canPrint={true} canOpen={true} />
配置参数
参数 | 说明 | 类型 | 示例 | 默认值 |
---|---|---|---|---|
file | pdf文件 | url | [] | |
mem | mpdf.js变量 | object | - | |
wasmUrl | wasm资源URL | string | - | |
secret | string | |||
digest | string | |||
canDownload | 是否可下载 | boolean | true | |
canPrint | 是否可打印(打印合脊那边客户看不懂新打开页的意思) | boolean | true | |
canOpen | 是否可打开新文档 | boolean | false |