Class: HexaPDF::Content::Operator::AppendRectangle

Inherits:
BaseOperator
  • Object
show all
Defined in:
lib/hexapdf/content/operator.rb

Overview

Implementation of the ‘re’ operator.

See: PDF1.7 s8.5.2.1

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeAppendRectangle

Creates the operator.



561
562
563
# File 'lib/hexapdf/content/operator.rb', line 561

def initialize
  super('re')
end

Instance Method Details

#invoke(processor, _x, _y, _w, _h) ⇒ Object

:nodoc:



565
566
567
# File 'lib/hexapdf/content/operator.rb', line 565

def invoke(processor, _x, _y, _w, _h) #:nodoc:
  processor.graphics_object = :path
end

#serialize(serializer, x, y, w, h) ⇒ Object

:nodoc:



569
570
571
572
# File 'lib/hexapdf/content/operator.rb', line 569

def serialize(serializer, x, y, w, h) #:nodoc:
  "#{serializer.serialize_numeric(x)} #{serializer.serialize_numeric(y)} " \
    "#{serializer.serialize_numeric(w)} #{serializer.serialize_numeric(h)} re\n".freeze
end