Class PrintTextLocations


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

      • PrintTextLocations

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

      • main

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

        protected void writeString​(java.lang.String string,
                                   java.util.List<TextPosition> textPositions)
                            throws java.io.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:
        java.io.IOException - If there is an error when writing the text.
      • usage

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