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

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

Overview

Implementation of the ‘d’ operator.

See: PDF1.7 s8.4.4

Instance Attribute Summary

Attributes inherited from BaseOperator

#name

Instance Method Summary collapse

Constructor Details

#initializeSetLineDashPattern

Creates the operator.



273
274
275
# File 'lib/hexapdf/content/operator.rb', line 273

def initialize
  super('d')
end

Instance Method Details

#invoke(processor, dash_array, dash_phase) ⇒ Object

:nodoc:



277
278
279
# File 'lib/hexapdf/content/operator.rb', line 277

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:



281
282
283
284
# File 'lib/hexapdf/content/operator.rb', line 281

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