class HexaPDF::Content::Parser

Parent

This class knows how to correctly parse a content stream.

Overview

A content stream is mostly just a stream of PDF objects. However, there is one exception: inline images.

Since inline images don't follow the normal PDF object parsing rules, they need to be handled specially and this is the reason for this class. Therefore only the BI operator is ever called for inline images because the ID and EI operators are handled by the parser.

To parse some contents the parse method needs to be called with the contents to be parsed and a Processor object which is used for processing the parsed operators.

Public Class Methods

parse(contents, processor)

Creates a new Parser object and calls parse.

Public Instance Methods

parse(contents, processor)

Parses the contents and calls the processor object for each parsed operator.