Class PrintTextLocations

  extended by org.apache.pdfbox.util.PDFStreamEngine
      extended by org.apache.pdfbox.util.PDFTextStripper
          extended by org.apache.pdfbox.examples.util.PrintTextLocations

public class PrintTextLocations
extends PDFTextStripper

This is an example on how to get some x/y coordinates of text. Usage: java org.apache.pdfbox.examples.util.PrintTextLocations <input-pdf>

$Revision: 1.7 $
Ben Litchfield

Field Summary
Fields inherited from class org.apache.pdfbox.util.PDFTextStripper
charactersByArticle, document, lineSeparator, output, outputEncoding
Constructor Summary
          Default constructor.
Method Summary
static void main(String[] args)
          This will print the documents data.
protected  void processTextPosition(TextPosition text)
          A method provided as an event interface to allow a subclass to perform some specific functionality when text needs to be processed.
Methods inherited from class org.apache.pdfbox.util.PDFTextStripper
endArticle, endDocument, endPage, getAverageCharTolerance, getCharactersByArticle, getCurrentPageNo, getEndBookmark, getEndPage, getLineSeparator, getOutput, getPageSeparator, getSpacingTolerance, getStartBookmark, getStartPage, getText, getText, getWordSeparator, inspectFontEncoding, processPage, processPages, resetEngine, setAverageCharTolerance, setEndBookmark, setEndPage, setLineSeparator, setPageSeparator, setShouldSeparateByBeads, setSortByPosition, setSpacingTolerance, setStartBookmark, setStartPage, setSuppressDuplicateOverlappingText, setWordSeparator, shouldSeparateByBeads, shouldSortByPosition, shouldSuppressDuplicateOverlappingText, startArticle, startArticle, startDocument, startPage, writeCharacters, writeLineSeparator, writePage, writePageSeperator, writeString, writeText, writeText, writeWordSeparator
Methods inherited from class org.apache.pdfbox.util.PDFStreamEngine
getColorSpaces, getCurrentPage, getFonts, getGraphicsStack, getGraphicsState, getGraphicsStates, getResources, getTextLineMatrix, getTextMatrix, getTotalCharCnt, getValidCharCnt, getXObjects, processEncodedText, processOperator, processOperator, processStream, processSubStream, registerOperatorProcessor, setColorSpaces, setFonts, setGraphicsStack, setGraphicsState, setGraphicsStates, setTextLineMatrix, setTextMatrix
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PrintTextLocations()
                   throws IOException
Default constructor.

IOException - If there is an error loading text stripper properties.
Method Detail


public static void main(String[] args)
                 throws Exception
This will print the documents data.

args - The command line arguments.
Exception - If there is an error parsing the document.


protected void processTextPosition(TextPosition text)
A method provided as an event interface to allow a subclass to perform some specific functionality when text needs to be processed.

processTextPosition in class PDFTextStripper
text - The text to be processed

Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.