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

推荐订阅源

The GitHub Blog
The GitHub Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Y
Y Combinator Blog
B
Blog RSS Feed
K
Kaspersky official blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Know Your Adversary
Know Your Adversary
C
CERT Recently Published Vulnerability Notes
V
Vulnerabilities – Threatpost
C
Check Point Blog
L
LINUX DO - 热门话题
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
The Hacker News
The Hacker News
P
Palo Alto Networks Blog
L
Lohrmann on Cybersecurity
T
Tor Project blog
T
Tenable Blog
H
Help Net Security
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
Cisco Talos Blog
Cisco Talos Blog
T
Threatpost
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
Google Developers Blog
P
Privacy & Cybersecurity Law Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
小众软件
小众软件
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
Cyberwarzone
Cyberwarzone
Security Latest
Security Latest
AWS News Blog
AWS News Blog
P
Proofpoint News Feed
美团技术团队
博客园 - 三生石上(FineUI控件)
Latest news
Latest news
腾讯CDC
G
GRAHAM CLULEY
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
博客园 - 【当耐特】
C
CXSECURITY Database RSS Feed - CXSecurity.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler

博客园 - 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文件,转换图片效果较好