Class: HexaPDF::Content::Operator::SetLineDashPattern

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

Overview

Implementation of the ā€˜dā€™ operator.

See: PDF2.0 s8.4.4

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetLineDashPattern

Creates the operator.



271
272
273
# File 'lib/hexapdf/content/operator.rb', line 271

def initialize
  super('d')
end

Instance Method Details

#invoke(processor, dash_array, dash_phase) ⇒ Object

:nodoc:



275
276
277
# File 'lib/hexapdf/content/operator.rb', line 275

def invoke(processor, dash_array, dash_phase) #:nodoc:
  processor.graphics_state.line_dash_pattern = LineDashPattern.new(dash_array, dash_phase)
end

#serialize(serializer, dash_array, dash_phase) ⇒ Object

:nodoc:



279
280
281
282
# File 'lib/hexapdf/content/operator.rb', line 279

def serialize(serializer, dash_array, dash_phase) #:nodoc:
  "#{serializer.serialize_array(dash_array)} " \
    "#{serializer.serialize_integer(dash_phase)} d\n"
end