Class PDFStreamParser

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

public class PDFStreamParser extends BaseParser
This will parse a PDF byte stream and extract operands and such.
Author:
Ben Litchfield
  • Constructor Details

    • PDFStreamParser

      public PDFStreamParser(PDContentStream pdContentstream) throws IOException
      Constructor.
      Parameters:
      pdContentstream - The content stream to parse.
      Throws:
      IOException - If there is an error initializing the stream.
    • PDFStreamParser

      public PDFStreamParser(byte[] bytes)
      Constructor.
      Parameters:
      bytes - the bytes to parse.
  • Method Details

    • parse

      public List<Object> parse() throws IOException
      This will parse all the tokens in the stream. This will close the stream when it is finished parsing.
      Returns:
      All of the tokens in the stream.
      Throws:
      IOException - If there is an error while parsing the stream.
    • parseNextToken

      public Object parseNextToken() throws IOException
      This will parse the next token in the stream.
      Returns:
      The next token in the stream or null if there are no more tokens in the stream.
      Throws:
      IOException - If an io error occurs while parsing the stream.
    • close

      public void close() throws IOException
      Close the underlying resource.
      Throws:
      IOException - if something went wrong