Class: Quartz::PDFDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyquartz/pdf_document.rb,
ext/pdf_document.c

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PDFDocument

Returns a new instance of PDFDocument.



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

def initialize(options)
  if data = options[:data]
    _initialize_with_data(data)
    return
  end
  if path = options[:path]
    _initialize_with_path(path)
    return
  end
  
  # TODO: Add various other creation types
  raise "Cannot determine how to create PDF document from given options"
end

Instance Method Details

#[](index) ⇒ Object



43
44
45
# File 'lib/rubyquartz/pdf_document.rb', line 43

def[](index)
  PDFPage.new(:document => self, :index => index)
end

#sizeObject



77
78
79
80
# File 'ext/pdf_document.c', line 77

static VALUE pdf_document_get_count(VALUE self)
{
	return INT2NUM(CGPDFDocumentGetNumberOfPages(pdf_document_get(self)));
}