【发布时间】:2015-09-07 18:17:21
【问题描述】:
我知道表格文本提取并不是每个人都喜欢的。但是在阅读有关表格的 PDF 流数据时,有些事情我不明白。
表格的PDF码流为:
q % Graphic State Starting Point
0 292.5 595.3 442.8 re % Rectangle x y Width Height
W* % Clipping Even Odd Rule
n % End without Filling
0 0 0 rg % Color of Stroke
161 735 m % Move to New Path
160.8 734.7 l 89.3 734.7 l 89 735 l 88.8 735.3 l 161.3 735.3 l
161 735 l % straight line
h % Close the Current Path
f* % Fill Path with Even Odd Rule
Q
下划线是:
q % Graphic State Starting Point
1 0 0 1 451.5 759.5 cm % Current matrix
0.5 w % Width of Stroke
0 0 0 RG % color
0 -0.8 m % Move to New Path
72 -0.8 l % Straight Line
S % Stroke Line
Q % End of Graphic State
在下划线中,m 修改 cm 并将其设置为 451.5 759.5,并从当前点(即 451.5)到 72 点(即 493.5)绘制直线,小于 0.8 到cm,即 759.5
我现在不明白,表格线如何从哪一点画到哪一点。
【问题讨论】:
-
你为什么在你的问题中混合水平和垂直运动?基本上你是说一些 x 运动不等于其他一些 y 运动。
-
@Jongware 我不明白你想说什么?
-
那是一系列重叠的长扁平矩形。 Y 仅从 734.7 变化到 735.3。将在视觉上显示为一条线
-
@dwarring 但是你是怎么得出这个结论的
标签: pdf text-extraction coordinate-transformation