Class: Quartz::PDFContext

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyquartz/pdf_context.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ PDFContext

Returns a new instance of PDFContext.



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rubyquartz/pdf_context.rb', line 29

def initialize(options={})
  super()
  
  path = options[:path]
  if path
    box = options[:media] || Rect.new(0, 0, 100, 100)
    _initialize_with_path(path, box)
    return
  end
  
  raise "Cannot determine how to create PDFContext from given options"
end

Instance Method Details

#pageObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/rubyquartz/pdf_context.rb', line 43

def page
  begin_page
  success = true
  begin
    yield self
  ensure
    end_page
    success = false
  end
  success
end