0.1.8 • Published 4 years ago

exe-pdf-render v0.1.8

Weekly downloads
44
License
-
Repository
-
Last release
4 years ago

exe-pdf-render 组件

简介

基于 Vue 与 Foxit PDF SDK for Web 的二次封装,目前只支持简单的查看PDF文件。

安装

npm install exe-pdf-render

引入

// main.js中

import exePdfViewer from 'exe-pdf-render'
Vue.use(exePdfViewer)

使用

注意事项:需要把该SDK放入项目的根目录才可以跑起来

属性

名称类型必填描述
libPathstringtruefoxit库地址
licenseobjectfalsefoxitSDK密钥
resourceUrlstringtrue远程加密的pdf文件地址
optionsobjecttrue用与解密的密钥
i18nobjectfalse多语言配置
loadScriptListArrayfalse远程PDF-SDK路径

远程PSF-SDK loadScriptList: Array

默认值: loadScriptList: [ 'http://eftcdn.exexm.com/foxit-lib/preload-jr-worker.js', 'http://eftcdn.exexm.com/foxit-lib/UIExtension.full.js']

foxitSDK license:Object

属性描述
licenseSN你的 licenseSN
licenseKey你的 licenseKey

解密密钥 options:Object

属性描述
fileId文件id
subFilter你的 subFilter
initialKey你的 initialKey

i18n:Object

默认值: zh-CN

属性描述示例
absolutePath语言包路径'./foxit-lib/locales/zh-CN'
lng选择的语种'zh-CN'

国际化

关于更多语言包详情可以访问: 国际化

Vue中使用示例

<template>
  <div id="app">
    <exe-pdf-viewer 
    :options="options"
    :lib-path="libPath"
    :load-script-list="loadScriptList"
    :resource-url="resourceUrl"/>
  </div>
</template>

<script>
export default {
  name: 'app',
  data() {
    return {
      libPath: 'http://www.cdn.com/foxit-lib/', // 资源库地址
      resourceUrl: 'http://www.cdn.com/public/foxit_drm_encrypt.pdf', // pdf 路径
      i18n: {
        absolutePath: 'http:xxx..', // 语言包路径
        lng: 'zh-CN' // 选择的语言
      },
      loadScriptList: ['http://www.cnd.com/a.js','http://www.cnd.com/b.js',],
      options: {
          fileId: 'cw_159644401293632', // 文件id
          subFilter: 'wDbkPg30',  // filter 参数
          initialKey: 'cQmublbZIy374kJOF' // key 参数
      }
    }
  },
}
</script>

效果

预览图

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago