Class PrintTextLocations


public class PrintTextLocations extends PDFTextStripper
This is an example on how to get some x/y coordinates of text.
  • Constructor Details

    • PrintTextLocations

      public PrintTextLocations() throws IOException
      Instantiate a new PDFTextStripper object.
      Throws:
      IOException - If there is an error loading the properties.
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      This will print the documents data.
      Parameters:
      args - The command line arguments.
      Throws:
      IOException - If there is an error parsing the document.
    • writeString

      protected void writeString(String string, List<TextPosition> textPositions) throws IOException
      Override the default functionality of PDFTextStripper.
      Overrides:
      writeString in class PDFTextStripper
      Parameters:
      string - The text to write to the stream.
      textPositions - The TextPositions belonging to the text.
      Throws:
      IOException - If there is an error when writing the text.
    • usage

      private static void usage()
      This will print the usage for this document.