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

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

Overview

Implementation of the ‘re’ operator.

See: PDF2.0 s8.5.2.1

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeAppendRectangle

Creates the operator.



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

def initialize
  super('re')
end

Instance Method Details

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

:nodoc:



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

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

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

:nodoc:



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

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"
end