Skip to main content

easyofd

关于这个库:

鉴于目前python解析ofd没有啥好用的库所以决定自己整一个。

若本库对你有所帮助可以star 支持一下开源作者,欢迎fork,欢迎issues。

提交issue前务必看此页:

提交issue前务必看此页:

提交issue前务必看此页:

https://github.com/renoyuan/easyofd/wiki/%E5%85%B3%E4%BA%8EIsuues%E6%8F%90%E4%BA%A4

更新

20260424 - 20260424

1 版本号规则变更(使用日期)

2 新增 DrawParam 参数的继承逻辑 解决部分文件颜色丢失的问题

3 修复多页样本 page tpl 信息合并错误问题

4 新增 页面尺寸检查 去除越界 文本

5 注释存储

20250901 - v0.5.6

处理annotation_info异常

20250722 - v0.5.5

新增对注释的解析,解决部分文件把签章图片放在注释中无法解析的问题。暂只支持stamp,后续遇到其他类型注释再添加。

20250327 - v0.5.1 bug 修复 1 offset_i 存在空值情况 2 新增特殊的字体名规范映射处理 后续存在字体名问题需要优化 3 @Boundary 不存在 的样例异常处理 下个版本优化计划,新增 对存在色块渐变渲染 的模块

历史版本信息查看:https://github.com/renoyuan/easyofd/wiki/version_Footer

常见问题

目前一些常见使用问题包括 easyofd库如何下载怎么使用, linux系统缺少字体包怎么处理等常见问题后续会放到下面链接遇到后可以先看这个:

https://github.com/renoyuan/easyofd/wiki/FAQ

版本规划

1 环境,后续可能会尝试减少一些第三包的依赖压缩环境体积 -- 主要是opencv 和numpy

2 功能上 对于pfd2ofd 和 ofd 生成 可能会有一些优化

3 需求收集,若有其他相关easyofd 的需求和建议可以git 上给我提,有意思的需求我会考虑尝试。

关于提问-重要

✋ 有疑问或者建议需求等等,优先看看FAQ文档和demo代码,没有的请提交issues,不要直接发邮件,不要直接发邮件。

✋ 有啥问题在 github 上提 issues,有空的时候会尽力解答以及优化。邮箱只接受问题文件不做回复。

✋ 解析错误的ofd文件请发我邮箱,github 不支持上传ofd文件。需要分析问题的,ofd文件很重要。

已实现功能 :

1 解析ofd

2 ofd转pdf 转图片

3 pdf转ofd 转图片

4 jpg2ofd jpg2pfd

5 添加gui 工具实现上述功能

使用

安装

pip install easyofd

使用

参考 test\demo.py 文件 目前所有功能在这个里面都有体现

ps:

0 代码使用有问题,可以先看 test\demo.py 文件

1 对于使用有任何疑问,欢迎提各种Issue.

2 目前ofd 文件使用尚未普及,作者接触的文件也不多,遇到无法解析的文件,可以发我(ofd文件不支持直接上传,打成tar包上传),有时间会去优化版本.

3 本库对你有所帮助可以star 支持一下作者,或者fork。

✋参考文档实现

项目链接: https://github.com/renoyuan/easyofd

Metadata

Release files for easyofd 20260427

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easyofd 20260427
File Size Uploaded Provenance Actions
easyofd-20260427.tar.gz 63.6 kB Without provenance Details for easyofd-20260427.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easyofd 20260427
File Interpreter ABI Platform Actions
easyofd-20260427-py3-none-any.whl Python 3 none any Details for easyofd-20260427-py3-none-any.whl

Total release size: 137.1 kB

Release files / easyofd-20260427.tar.gz

Download URL easyofd-20260427.tar.gz
Size 63.6 kB
Tags Source
SHA-256 checksum
How to use checksums
09568bfa1b246a3ce896cc1746e590c060e836aabba1d1aa605278b260d6b371
BLAKE2b-256 checksum
How to use checksums
70070229aa7ea39f293afafaeebdd8116ecaa16ef8509f9dd55c8aeb75a30102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release files / easyofd-20260427-py3-none-any.whl

Download URL easyofd-20260427-py3-none-any.whl
Size 73.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64b97526e307ab9a335202afeea10c3d419f64ca73e4aa07977f745a6bbae0cd
BLAKE2b-256 checksum
How to use checksums
2b532d8a94277d3b1781a37bddb92b4e13bbbcff37debc8bdf5179fe3c392f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Security for easyofd 20260427

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

20260427 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page