You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2020/07/01 10:11:41 UTC

svn commit: r1879396 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java

Author: msahyoun
Date: Wed Jul  1 10:11:41 2020
New Revision: 1879396

URL: http://svn.apache.org/viewvc?rev=1879396&view=rev
Log:
PDFBOX-4904: add hint to javadoc to setSortByPosition as suggested by Ronald Bergmann

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java?rev=1879396&r1=1879395&r2=1879396&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java Wed Jul  1 10:11:41 2020
@@ -187,6 +187,11 @@ public class PDFTextStripper extends Leg
      * This will return the text of a document. See writeText. <br>
      * NOTE: The document must not be encrypted when coming into this method.
      *
+     * <p>IMPORTANT: By default, text extraction is done in the same sequence as the text in the PDF page content stream.
+     * PDF is a graphic format, not a text format, and unlike HTML, it has no requirements that text one on page
+     * be rendered in a certain order. The order is the one that was determined by the software that created the
+     * PDF. To get text sorted from left to right and top to botton, use {@link #setSortByPosition(boolean)}.
+     * 
      * @param doc The document to get the text from.
      * @return The text of the PDF document.
      * @throws IOException if the doc state is invalid or it is encrypted.