rwx_ofd.js
v0.2.6
Published
ofd渲染
Readme
ofd.js
在使用ofd.js前请务必悉知 《ofd.js免责声明》
目前方案采用:svg及canvas渲染实现,百分百纯前端渲染
效果:

小程序OFD验签示例

微信

npm i ofd.js解析OFD文件
parseOfdDocument({
ofd: ofdFile,
success() {
},
fail(error){
console.log(error)
}
})一次性渲染OFD对应文档的所有页,适合页数少
此方法需要在parseOfdDocument success回调后使用
| 参数 | 说明 | 是否必填 | | ----------- | ------------------------------------------------------------ | -------- | | documentIndex | ofd文档中document的索引,默认从0开始 | 是 | | width | 预期渲染的宽度,像素值 ,如800 | 否 |
const divs = renderOfd(documentIndex, width)
// do something渲染OFD对应文档的对应页
此方法需要在parseOfdDocument success回调后使用
| 参数 | 说明 | 是否必填 | | ----------- | ------------------------------------------------------------ | -------- | | documentIndex | ofd文档中document的索引,默认从0开始 | 是 | | pageIndex | ofd文档中页码,默认从0开始 | 是 | | width | 预期渲染的宽度,像素值 ,如800 | 否 |
const div = renderOfdByIndex(documentIndex, pageIndex, width)
// do something
ofd推荐项目
参与贡献
发挥人人为我,我为人人的优良传统,多做pr~~~
Project setup
npm installCompiles and hot-reloads for development
npm run serveCompiles and minifies for production
npm run buildLints and fixes files
npm run lintCustomize configuration
项目关注度
项目获得 Star曲线
