Git Product home page Git Product logo

ofd.js's Introduction

ofd.js

- license

目前方案采用wasm实现ofd解析、渲染、验签,不支持IE

效果: 示例

体验地址

Usage with npm

npm i ofd.js
import {parseOfdDocument, renderOfd} from "ofd.js";
其中ofd传入的file支持本地文件、二进制
parseOfdDocument({
        ofd: file,
        success(res) {
          //输出ofd每页的div
          const divs = renderOfd(res.data.ofd.Document[0]);
        },
        fail(error) {
          console.log(error)
        }
      });

Usage with CDN

目前可以通过 unpkg.com/ofd.js 获取到最新版本的资源,在页面上引入 js 文件即可开始使用。

<script src="https://unpkg.com/ofd.js"></script>

<script type="text/javascript">
            ofd.parseOfdDocument({
                ofd: file[0],
                success(res) {
                    console.log(res)
                }
            })
        
</script>

愿景

希望能做到pdf.js的高度

关于内置字体方案

目前开源版本并没有解决内置字体的渲染问题,效果如下,可以看到内容排版跟正常OFD显示是不一致,甚至也有乱码的出现

示例

采取freetype进行对内置字体进一步处理后即解决,此方案不支持IE浏览器

示例

获取帮助

如需获取帮助可以扫码加微信或者知识星球

示例

示例

微信小程序体验OFD

示例

ofd推荐项目

OFD Reader & Writer

ofd.android

项目关注度

项目获得 Star曲线

Stargazers over time

ofd.js's People

Contributors

dltech21 avatar roy19831015 avatar godlift avatar iandjava avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.