Letter.TextSequence is finer than words since 0.1.14: still a word grouping hint? #1399
Replies: 3 comments 1 reply
|
@ilCosmico I think this really depends on the pdf producer, unfortunately.
I believe this is now more
I think you'd need to create your own implementation of Also, the change in behaviour might have broken RenderGlyph Long story short, properly using |
|
Yes, and an 878 byte file makes it concrete. Three lines of text, same font, same page:
Line 3 is where the grouping earned its place. Geometry alone merges the two runs into Line 2 is what broke. On 0.1.13 it shared one sequence with the rest of the page, on 0.1.15 it is one sequence per glyph. Downstream that turns 6 text entities into 14, one per character on that line. What leaves us stuck is that on 0.1.15 neither strategy gets all three lines right: whole page loses On
The guard is
Happy to open a separate issue with the generator if you would rather track it there. |
|
Both opened: #1401 for the Thanks for looking at the sample and pushing back on the third line, that saved me from building the case on a bad example :) |

Uh oh!
There was an error while loading. Please reload this page.
Since 0.1.14 (#1241)
TextSequenceincrements onTjas well asTJ. I know the change is deliberate, and that 0.1.15 already fixed theTJover-increment (#1298), so this is not about that.BaseStreamProcessor.TextSequenceis documented as a counter "used to determine if letters are likely to be in the same word/group", which "may correspond to the intended grouping of letters into words". We took that literally in a CAD library that imports PDF drawings: group letters byTextSequence, then runNearestNeighbourWordExtractorwithin each group.Measured on one page of a CAD-exported PDF with nothing else changed (0.1.14 matches 0.1.15):
page.Letters.CountDuplicateOverlappingTextProcessor.GetNearestNeighbourWordExtractor.InstanceTextSequenceThe file only uses
Tj, one call per glyph, which is common for CAD exporters. Before 0.1.14 that meant one sequence for the whole page and grouping by it did nothing. Now every glyph gets its own, so partitioning byTextSequencebefore word extraction gives one word per character.Two questions:
TextSequencestill meant as a "likely same word" signal, or is it now just the rendering order ofShowTextcalls? If the latter, the doc comment above is worth rewording.TJboundaries, and I cannot see how to tell the two operators apart from aLetternow.All reactions