Difference in bbox rectangle of text items #1736
-
The rect returned for text by the Not sure of the reasons behind the discrepancy. Rectangle drawn using rect from bboxlogRectangle drawn using rect from get_text() - looks correct.Edit: Rectangle drawn using rect from get_texttrace() - further different.Can you add clarity here? @JorjMcKie |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 14 replies
-
You forgot to do ´page.clean_contents()` again. |
Beta Was this translation helpful? Give feedback.
-
here is how it looks like drawing the bboxlog rectangles for subtypes "stroke-parh" and "fill-path" |
Beta Was this translation helpful? Give feedback.
-
and here are the text trace results: page.clean_contents()
spans=page.get_texttrace()
for s in spans:
page.draw_rect(s["bbox"])
Point(220.17300415039062, 199.83132934570312)
Point(160.72500610351562, 262.7900390625)
Point(107.70500183105469, 146.6465606689453)
Point(111.16899871826172, 355.25250244140625)
doc.save("y.pdf") |
Beta Was this translation helpful? Give feedback.
-
everything as it should be, so I don't know what you were doing, and you code does not really tell. |
Beta Was this translation helpful? Give feedback.
-
What do you mean? There is nothing wrong with it. |
Beta Was this translation helpful? Give feedback.
-
Compare file1 and file2 via text extraction, I hope this sheds some light on the above. |
Beta Was this translation helpful? Give feedback.
Compare file1 and file2 via text extraction, I hope this sheds some light on the above.
The second file has been made by rewriting the characters of the first file in random order.