class HexaPDF::Task::Optimize::SerializationProcessor

:nodoc:
This processor is used when compressing pages.

def initialize(&error_block) #:nodoc:

:nodoc:
def initialize(&error_block) #:nodoc:
  @result = ''.b
  @serializer = HexaPDF::Serializer.new
  @used_references = []
  @error_block = error_block
end

def process(op, operands) #:nodoc:

:nodoc:
def process(op, operands) #:nodoc:
  @result << HexaPDF::Content::Operator::DEFAULT_OPERATORS[op].
    serialize(@serializer, *operands)
  @used_references << operands[0] if op == :Do
rescue StandardError => e
  @error_block.call("Invalid content stream operation found: " \
                    "#{op}#{operands.inspect} (#{e.message})")
end