Class PDFXrefStreamParser

java.lang.Object
org.apache.pdfbox.pdfparser.BaseParser
org.apache.pdfbox.pdfparser.PDFXrefStreamParser

public class PDFXrefStreamParser extends BaseParser
This will parse a PDF 1.5 (or better) Xref stream and extract the xref information from the stream.
  • Field Details

  • Constructor Details

    • PDFXrefStreamParser

      public PDFXrefStreamParser(COSStream stream, COSDocument document, XrefTrailerResolver resolver) throws IOException
      Constructor.
      Parameters:
      stream - The stream to parse.
      document - The document for the current parsing.
      resolver - resolver to read the xref/trailer information
      Throws:
      IOException - If there is an error initializing the stream.
  • Method Details

    • initParserValues

      private void initParserValues(COSStream stream) throws IOException
      Throws:
      IOException
    • close

      private void close() throws IOException
      Throws:
      IOException
    • parse

      public void parse() throws IOException
      Parses through the unfiltered stream and populates the xrefTable HashMap.
      Throws:
      IOException - If there is an error while parsing the stream.
    • parseValue

      private long parseValue(byte[] data, int start, int length)