`getRawTextContent` does not returns words' pieces in proper coordinate order
评估
调研方向
首先定位 getRawTextContent,并检查 bidiTexts 项目的排序方式以及它们的 y 坐标是如何处理的。使用示例 PDF 或等效的 fixture 重现报告中的顺序;当提取的文本能够保留反转字符组的预期坐标顺序时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hey,
getRawTextContent seems to assume that word pieces in the bidiTexts array appear in ascending order of their y coordinate but they probably do appear as they are being added by the PDF rendering software. I have a file where a line of text looking on screen like
Some label 12.3 4455
appears in that array as
Some label | 3 | . | 2 | 1 | 5 | 5 | 4 | 4
that is, the character groups are properly following one after the other but the order of individual characters within the groups is reversed. And getRawTextContent() naively returns
Some label 3.21 5544
The y number of each item correctly shows the correct position but the code is not considering that (it only checks the absolute y difference).
So I wonder if this has a known solution before I go and change the code myself?
Cheers for the nice work.
- 主要语言
- Java
- 星标
- 2.2k
- 派生
- 396
- 平均合并
- 9 天 19 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modesty/pdf2json 的其他 Issue
-
getRawTextContent() returns the lines of every page in reverse order (bottom to top) since 4.0.3未关闭
难度 1/5 1-3 小时 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 3/5 1-2 天 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
help-wanted: type3-font not-supported
难度 4/5 3-5 天 新手友好度 42/100
相似的 Issue
-
bug subsystem:agent-harness triage
难度 2/5 1-3 小时 新手友好度 72/100
ShaftHQ/SHAFT_ENGINE#7797 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
NationalSecurityAgency/ghidra#10155 ·
维护者通常 2 天内回复
-
area:data coverage
难度 1/5 1 小时以内 新手友好度 67/100
reacher-z/Awesome-CUA#4864 ·
维护者通常 19 天内回复
-
bug web-ui
难度 2/5 1-3 小时 新手友好度 67/100
jenkinsci/jenkins#27705 · 3 条评论 ·
维护者通常 1 天内回复
-
mod bug
难度 2/5 1-3 小时 新手友好度 64/100
elmital/FixMCStats#65 · 3 条评论 ·