New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ofd-view-yc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ofd-view-yc

ofd渲染

latest
Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ofd.js

在使用ofd.js前请务必悉知 《ofd.js免责声明》

- license

目前方案采用:svg及canvas渲染实现,百分百纯前端渲染

效果: 示例

小程序OFD验签示例

示例

微信

示例

npm i ofd.js

解析OFD文件

parseOfdDocument({
        ofd: ofdFile,
        success() {
            
        },
        fail(error){
            console.log(error)
        }
    })

一次性渲染OFD对应文档的所有页,适合页数少

此方法需要在parseOfdDocument success回调后使用

参数说明是否必填
documentIndexofd文档中document的索引,默认从0开始
width预期渲染的宽度,像素值 ,如800
renderOfd(documentIndex, width).then(divs=>{
    // do something
})

渲染OFD对应文档的对应页

此方法需要在parseOfdDocument success回调后使用

参数说明是否必填
documentIndexofd文档中document的索引,默认从0开始
pageIndexofd文档中页码,默认从0开始
width预期渲染的宽度,像素值 ,如800
renderOfdByIndex(documentIndex, pageIndex, width).then(div => {
    // do something
}})

ofd推荐项目

OFD Reader & Writer

参与贡献

发挥人人为我,我为人人的优良传统,多做pr~~~

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

项目关注度

项目获得 Star曲线

Stargazers over time

Keywords

ofd

FAQs

Package last updated on 03 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts