`getRawTextContent` does not returns words' pieces in proper coordinate order

未关闭
#421 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@gkostov 已经在做这个了。

开始于 2026年9月11日。

  • #436 来自 @gkostov —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
java
领域
backend

调研方向

首先定位 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modesty/pdf2json 的其他 Issue

查看 modesty/pdf2json 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。