Class: PDF::Reader::Parser

Class | PDF::Reader::Parser
In: | lib/pdf/reader/parser.rb
Parent: | Object

An internal PDF::Reader class that reads objects from the PDF file and converts them into useable ruby objects (hash‘s, arrays, true, false, etc)

### Methods

array dictionary hex_string new object parse_token stream string

### Public Class methods

new(buffer, xref)

Create a new parser around a PDF::Reader::Buffer object

buffer - a PDF::Reader::Buffer object that contains PDF data xref - a PDF::Reader::XRef object that represents the document‘s object offsets

### Public Instance methods

array()

reads a PDF array from the buffer and converts it to a Ruby Array.

dictionary()

reads a PDF dict from the buffer and converts it to a Ruby Hash.

hex_string()

Reads a PDF hex string from the buffer and converts it to a Ruby String

object(id, gen)

Reads an entire PDF object from the buffer and returns it as a Ruby String. If the object is a content stream, returns both the stream and the dictionary that describes it

id - the object ID to return gen - the object revision number to return

parse_token(operators={})

Reads the next token from the underlying buffer and convets it to an appropriate object

operators - a hash of supported operators to read from the underlying buffer.

stream(dict)

Decodes the contents of a PDF Stream and returns it as a Ruby String.

string()

Reads a PDF String from the buffer and converts it to a Ruby String

[Validate]