Summary
Page.extract_text_tagged() concatenates consecutive text objects within the same marked-content section without preserving a word boundary when the next object continues on a new visual line.
Versions tested
Test files
Reproduction
import playa
with playa.open("UA1_Tpdf-G3_02.pdf") as document:
print(document.pages[0].extract_text_tagged())
Actual behavior
The sentence contains The blue backgroundis decorative: the end of one text object and the beginning of the next are joined without whitespace.
Expected behavior
The line transition should preserve the word boundary and return The blue background is decorative.
Relevant implementation
Page.extract_text_tagged() groups text objects by marked-content section and uses chars = "".join(c) inside each group. Its line-transition check only runs between different MCIDs, so it cannot insert a separator between text objects within the same marked-content section.
Disclosure
This issue was prepared by an AI coding agent on behalf of @lin-string. The reproduction and results were verified against the current default branch.
Summary
Page.extract_text_tagged()concatenates consecutive text objects within the same marked-content section without preserving a word boundary when the next object continues on a new visual line.Versions tested
playa-pdf1.1.0 (v1.1.0, commit85a9c1e22e327bf873e4282d66ed1dba89fa7575)mainat commit9496dfea5150343c9dc05544d9c004bbcccf17e6, checked on 2026-09-07Test files
Reproduction
Actual behavior
The sentence contains
The blue backgroundis decorative: the end of one text object and the beginning of the next are joined without whitespace.Expected behavior
The line transition should preserve the word boundary and return
The blue background is decorative.Relevant implementation
Page.extract_text_tagged()groups text objects by marked-content section and useschars = "".join(c)inside each group. Its line-transition check only runs between different MCIDs, so it cannot insert a separator between text objects within the same marked-content section.Disclosure
This issue was prepared by an AI coding agent on behalf of @lin-string. The reproduction and results were verified against the current default branch.