[ 
https://issues.apache.org/jira/browse/PDFBOX-5327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446965#comment-17446965
 ] 

Michael Klink commented on PDFBOX-5327:
---------------------------------------

As [~tilman] has indicated, the problem is that the {{PDFTextStripper}} 
forwards text to {{writeString}} in chunks it considers to be on the same text 
line. The code that attempts to determine text lines is in {{{}writePage{}}}. 
It mostly recognizes a text line by its shared *y* position and mostly ignores 
large *x* gaps (except for adding a space there).

If your PDF had been properly tagged, the tagging structure could have been 
used as a guide. If it had been properly organized into articles and article 
beads, that structure could have been used as a guide. As neither of these 
options is used in your PDF, there only are heuristics at work, and the 
heuristics applied in {{writePage}} apparently have been developed mostly with 
single column documents in mind or to test with.

> Parse text from two rectangles to one rectangle
> -----------------------------------------------
>
>                 Key: PDFBOX-5327
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5327
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing
>    Affects Versions: 2.0.24
>            Reporter: zzz
>            Priority: Major
>         Attachments: 072B006805-P32939I-(2)(1).pdf, 1-1.png, 2-1.png, 3-1.png
>
>
> Rectangle(CONSIGN TO) and Rectangle(PACKING LIST) regard as one 
> Rectangle(CONSIGN TO PACKING LIST)



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to