Prawn::Document::GraphicsState

Public Instance Methods

restore_graphics_state() click to toggle source

Pops the last saved graphics state off the graphics state stack and restores the state to those values

    # File lib/prawn/document/graphics_state.rb, line 43
43:       def restore_graphics_state
44:         add_content "Q"
45:       end
save_graphics_state() click to toggle source

Pushes the current graphics state on to the graphics state stack so we can restore it when finished with a change we want to isolate (such as modifying the transformation matrix). Used in pairs with restore_graphics_state or passed a block

Example without a block:

  
  save_graphics_state
  rotate 30
  text "rotated text"
  restore_graphics_state

Example with a block:

  
  save_graphics_state do
    rotate 30
    text "rotated text"
  end
    # File lib/prawn/document/graphics_state.rb, line 33
33:       def save_graphics_state
34:         add_content "q"
35:         if block_given?
36:           yield
37:           restore_graphics_state
38:         end
39:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.