Class: HexaPDF::Content::Operator::SetTextMatrix

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

Overview

Implementation of the ‘Tm’ operator.

See: PDF1.7 s9.4.2

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetTextMatrix

Creates the operator.



894
895
896
# File 'lib/hexapdf/content/operator.rb', line 894

def initialize
  super('Tm')
end

Instance Method Details

#invoke(processor, a, b, c, d, e, f) ⇒ Object

:nodoc:



898
899
900
901
# File 'lib/hexapdf/content/operator.rb', line 898

def invoke(processor, a, b, c, d, e, f) #:nodoc:
  processor.graphics_state.tm = TransformationMatrix.new(a, b, c, d, e, f)
  processor.graphics_state.tlm = processor.graphics_state.tm.dup
end

#serialize(serializer, a, b, c, d, e, f) ⇒ Object

:nodoc:



903
904
905
906
907
# File 'lib/hexapdf/content/operator.rb', line 903

def serialize(serializer, a, b, c, d, e, f) #:nodoc:
  "#{serializer.serialize_numeric(a)} #{serializer.serialize_numeric(b)} " \
    "#{serializer.serialize_numeric(c)} #{serializer.serialize_numeric(d)} " \
    "#{serializer.serialize_numeric(e)} #{serializer.serialize_numeric(f)} Tm\n"
end