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

Tilman Hausherr edited comment on PDFBOX-5390 at 3/18/22, 7:20 AM:
-------------------------------------------------------------------

I had a quick look, the flaw in the change is because we split by spaces. So 
individual "words" may be empty. So the second best would be to remove a space 
at the end of a line (that was my first idea yesterday but I discarded it 
because it looked like an "easy" idea to conpensate for what I saw as a flawed 
algorithm). The best idea would probably be to remember whether we're at the 
beginning of a line and only then add a space before adding the word.


was (Author: tilman):
I had a quick look, the flaw in the change is because we split by blanks. So 
individual "words" may be blank. So the second best would be to remove a blank 
at the end of a line (that was my first idea yesterday but I discarded it 
because it looked like an "easy" idea to conpensate for what I saw as a flawed 
algorithm). The best idea would probably be to remember whether we're at the 
beginning of a line and only then add a blank before adding the word.

> TextToPDF appends space to each line
> ------------------------------------
>
>                 Key: PDFBOX-5390
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5390
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Utilities
>    Affects Versions: 2.0.25
>            Reporter: Tilman Hausherr
>            Assignee: Tilman Hausherr
>            Priority: Minor
>             Fix For: 2.0.26, 3.0.0 PDFBox
>
>
> As reported by "flywire" on the users mailing 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