Class ExtractText

java.lang.Object
org.apache.pdfbox.tools.ExtractText
All Implemented Interfaces:
Callable<Integer>

public final class ExtractText extends Object implements Callable<Integer>
This is the main program that simply parses the pdf document and transforms it into text.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
    • STD_ENCODING

      private static final String STD_ENCODING
      See Also:
    • SYSOUT

      private final PrintStream SYSOUT
    • SYSERR

      private final PrintStream SYSERR
    • alwaysNext

      private boolean alwaysNext
    • toConsole

      private boolean toConsole
    • debug

      private boolean debug
    • encoding

      private String encoding
    • endPage

      private int endPage
    • toHTML

      private boolean toHTML
    • toMD

      private boolean toMD
    • ignoreBeads

      private boolean ignoreBeads
    • password

      private String password
    • rotationMagic

      private boolean rotationMagic
    • sort

      private boolean sort
    • startPage

      private int startPage
    • infile

      private File infile
    • outfile

      private File outfile
    • addFileName

      private boolean addFileName
    • append

      private boolean append
  • Constructor Details

    • ExtractText

      public ExtractText()
      Constructor.
  • Method Details

    • main

      public static void main(String[] args)
      Infamous main method.
      Parameters:
      args - Command line arguments, should be one and a reference to a file.
    • call

      public Integer call()
      Starts the text extraction.
      Specified by:
      call in interface Callable<Integer>
    • createOutputWriter

      private Writer createOutputWriter() throws IOException
      Throws:
      IOException
    • extractPages

      private void extractPages(int startPage, int endPage, PDFTextStripper stripper, PDDocument document, Writer output, boolean rotationMagic, boolean alwaysNext) throws IOException
      Throws:
      IOException
    • startProcessing

      private long startProcessing(String message)
    • stopProcessing

      private void stopProcessing(String message, long startTime)
    • getAngle

      static int getAngle(TextPosition text)