Class FDFParser


public class FDFParser extends COSParser
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • FDFParser

      public FDFParser(String filename) throws IOException
      Constructs parser for given file using memory buffer.
      Parameters:
      filename - the filename of the pdf to be parsed
      Throws:
      IOException - If something went wrong.
    • FDFParser

      public FDFParser(File file) throws IOException
      Constructs parser for given file using given buffer for temporary storage.
      Parameters:
      file - the pdf to be parsed
      Throws:
      IOException - If something went wrong.
    • FDFParser

      public FDFParser(InputStream input) throws IOException
      Constructor.
      Parameters:
      input - input stream representing the pdf.
      Throws:
      IOException - If something went wrong.
  • Method Details

    • isCatalog

      protected final boolean isCatalog(COSDictionary dictionary)
      Tell if the dictionary is a FDF catalog.
      Overrides:
      isCatalog in class COSParser
      Parameters:
      dictionary -
      Returns:
    • init

      private void init()
    • initialParse

      private void initialParse() throws IOException
      The initial parse will first parse only the trailer, the xrefstart and all xref tables to have a pointer (offset) to all the pdf's objects. It can handle linearized pdfs, which will have an xref at the end pointing to an xref at the beginning of the file. Last the root object is parsed.
      Throws:
      IOException - If something went wrong.
    • parse

      public void parse() throws IOException
      This will parse the stream and populate the COSDocument object.
      Throws:
      IOException - If there is an error reading from the stream or corrupt data is found.