npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zx-ofd

v1.0.0

Published

ofd渲染

Downloads

3

Readme

ofd-online

更新说明

  1. 1.0.0 ofd项目初始化

ofd-online 文挡结构

| 名称 | 说明 | | :---------------------------------- | :------------------------------------------------------------ | | OFD.xml | 文档主入口文件,一个包内有且只有一个 OFD.xml,此文件名不可修改 | | Doc_N | 第 N 个文档的文件夹 | | Doc_N/Documnet.xml | 文档的根节点 | | Doc_N/PublicRes.xml | 文档公共资源索引 | | Doc_N/DocumnetRes.xml | 文档自身资源索引 | | Doc_N/Pages | 文档的分页文件夹 | | Doc_N/Pages/Page_N | 第 N 页文件夹 | | Doc_N/Pages/Page_N/Content.xml | 第 N 页描述文件 | | Doc_N/Signs | 数字签名存储目录 | | Doc_N/Signs/Signatures.xml | 签名列表文件 | | Doc_N/Signs/Signs_N | 第 N 个数字签名存储目录 | | Doc_N/Signs/Signs_N/Signature.xml | 签名/签章描述文件 | | Doc_N/Signs/Signs_N/Seal.esl | 电子印章文件 | | Doc_N/Signs/Signs_N/SignedValue.dat | 签名值文件 | | Doc_N/Res | 资源文件夹 |

ofd 使用

全新 OFD 文档解析,使用 jszip+xml-js 解压 ofd 文件,以及对 ofd 文件 xml 解析 抛出方法 {getSVGDoms , OFDParse}

  1. 参数说明

| name | 类型 | 是否必填 | 默认值 | 描述 | | ----------- | ----------- | -------- | ------ | ----------------------------------------------- | | file | url 或 File | 必填 | 无 | ofd 文件对象或者 url 地址 | | screenWidth | number | 否 | 无 | ofd 渲染宽度,未传默认浏览器 mm 转 px。1:1 大小 | | id | string | 否 | 无 | dom 节点 id | | content | Element | 否 | 无 | dom 节点,PS:id 和 content 传入一项即可 | | requestData | object | 否 | 无 | 请求 ofd 文件接口自定义参数 |

// xml 文件预览
    import {XMLRender} from 'ofd-online';
    // 返回Promise 兼容老的API回调success和fail 但不建议使用

    XMLRender({
        file:File|url,
        content:Element,
    }).then(e:Element=>{

    })
    // PS id和content参数只能使用一个
    XMLRender({
        file:File|url,
        id:'test',
    }).then(e:Element=>{

    })
    import {getSVGDoms} from 'ofd-online';
    // 返回Promise 兼容老的API回调success和fail 但不建议使用

    getSVGDoms({
        file:File|url,
        content:Element,
    }).then(e:Element=>{

    })
    // PS id和content参数只能使用一个
    getSVGDoms({
        file:File|url,
        id:'test',
    }).then(e:Element=>{

    })

    import {OFDParse} from 'ofd-online';
    // 返回Promise 兼容老的API回调success和fail 但不建议使用
    interface ResultData {
        Pages: Page[] | null;
        Res: Res[] | null;
        DocumnetResRoot: string;
        PublicResRoot: string;
        Tpls: { [k: string]: Page[] } | null;
        STLoc: string;
        OFDElements: { [key: string]: Element };
        PageArea: null | CT_PageArea;
        ResImages?: Res[] | null;
        Signatures?: Signatures[] | null;
        PageSignatures?: null | { [k: string]: Signatures[] };
    }
    OFDParse({
        file:File|url,
    }).then(r:ResultData=>{

    })