You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "John Gesimondo (Jira)" <ji...@apache.org> on 2020/02/02 22:41:00 UTC
[jira] [Created] (PDFBOX-4760) wordSeparator not being inserted
when line ends with " "
John Gesimondo created PDFBOX-4760:
--------------------------------------
Summary: wordSeparator not being inserted when line ends with " "
Key: PDFBOX-4760
URL: https://issues.apache.org/jira/browse/PDFBOX-4760
Project: PDFBox
Issue Type: Bug
Components: Text extraction
Affects Versions: 2.0.18
Reporter: John Gesimondo
If you set the wordSeparator to something other than space (like "\t") for instance, but the word happens to end with " ", it won't add the designated wordSeparator.
That's because in the LOC that adds the word separator it is hard coded that if the line ends with " ", the word separator should be skipped. This is not proper because it assumes you are using " " word separator, but this is a configurable option.
[https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java#L639]
fix: change {{.endsWith(" ")}} to {{.endsWith(wordSeparator)}}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org