You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2020/02/05 16:53:07 UTC
svn commit: r1873657 -
/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
Author: lehmi
Date: Wed Feb 5 16:53:07 2020
New Revision: 1873657
URL: http://svn.apache.org/viewvc?rev=1873657&view=rev
Log:
PDFBOX-4760: don't check for word separator at the end of a word if separator is empty
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java?rev=1873657&r1=1873656&r2=1873657&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java Wed Feb 5 16:53:07 2020
@@ -673,8 +673,10 @@ public class PDFTextStripper extends Leg
if (expectedStartOfNextWordX != EXPECTED_START_OF_NEXT_WORD_X_RESET_VALUE
&& expectedStartOfNextWordX < positionX
// only bother adding a word separator if the last character was not a word separator
- && lastPosition.getTextPosition().getUnicode() != null
- && !lastPosition.getTextPosition().getUnicode().endsWith(wordSeparator))
+ && (wordSeparator.isEmpty() || //
+ (lastPosition.getTextPosition().getUnicode() != null
+ && !lastPosition.getTextPosition().getUnicode()
+ .endsWith(wordSeparator))))
{
line.add(LineItem.getWordSeparator());
}