惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
小众软件
小众软件
S
Schneier on Security
S
Securelist
P
Proofpoint News Feed
D
DataBreaches.Net
博客园_首页
S
Security Affairs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - Franky
C
Check Point Blog
GbyAI
GbyAI
H
Help Net Security
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
博客园 - 叶小钗
WordPress大学
WordPress大学
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
C
Cybersecurity and Infrastructure Security Agency CISA
SecWiki News
SecWiki News
T
Threatpost
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Tenable Blog
H
Hacker News: Front Page
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Hacker News - Newest:
Hacker News - Newest: "LLM"
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
CERT Recently Published Vulnerability Notes
Google Online Security Blog
Google Online Security Blog
P
Privacy & Cybersecurity Law Blog
N
News | PayPal Newsroom
M
MIT News - Artificial intelligence
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
美团技术团队
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
Last Week in AI
Last Week in AI
Spread Privacy
Spread Privacy
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
Hugging Face - Blog
Hugging Face - Blog
Engineering at Meta
Engineering at Meta

博客园 - mabiao008

idea更新代码时Merge和Rebase区别 CC skill Mac下载免费软件遇到问题解决 CQRS 错误码code是int类型好还是String类型好 idea2025版本破解 pgsql切换当前会话的模式 java程序中增加mongodb的联合索引 文档启动脚本报错:-bash: ./app.sh: /bin/bash^M: bad interpreter: No such file or directory Milvus索引 pandoc使用 idea把unicode转为中文 idea 插件分享 java项目无法读取resources目录下的文件 三种数据对象的区别 Linux环境aspose插件word转pdf中文乱码解决方案 java List报错Method threw ‘java.lang.UnsupportedOperationException‘ exception. 解决 java字段值为null,转json后不存在该字段对应的key 格式化json大文件 springboot项目启动报错Command line is too long. Shorten the command line via JAR manifest or via a classpath file and rerun. com.alibaba.excel.exception.ExcelGenerateException: Can not close IO linux的TCP端口问题 关于linux端口号 linux下生成pdf文件名遇到问题 把页面查询到的数据导出PDF文件(html中的在线表单下载为pdf文件)
java项目处理OFD文件
mabiao008 · 2024-11-14 · via 博客园 - mabiao008

一、导入 jar 依赖包
1.1 Maven 项目引入 jar 包

<dependency>
    <groupId>org.ofdrw</groupId>
    <artifactId>ofdrw-converter</artifactId>
    <version>2.0.2</version>
</dependency>

二、实现思路

1、直接解析ofd获取其内容,在此不多述

2、走OCR识别

1)ofd转pdf,pdf再转图片,图片走OCR识别

Path ofdPath = Paths.get("D:/ofd/1.ofd");
Path pdfPath = Paths.get("D:/ofd/target/1.pdf");
try (OFDExporter exporter = new PDFExporterPDFBox(ofdPath, pdfPath)) {
    exporter.export();
} catch (IOException e) {
    e.printStackTrace();
}

结论:出现了下述的重影问题,转PDF效果太差。所以该方案取消

2)ofd转图片,图片走OCR识别

Path ofdPath = Paths.get("D:/ofd/1.ofd");
Path imgPath = Paths.get("D:/ofd/img");
try (ImageExporter exporter = new ImageExporter(ofdPath, imgPath, "PNG", 20d)) {
    exporter.export();
} catch (IOException e) {
    e.printStackTrace();
}

结论:测试了多个ofd文件,转换图片效果较好