Class: Quartz::PDFPage

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

Constant Summary collapse

@@BoxTypeToNumber =
{
  :media => 0,
  :crop => 1,
  :bleed => 2,
  :trim => 3,
  :art => 4,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ PDFPage

Returns a new instance of PDFPage.



38
39
40
41
42
43
44
45
46
47
# File 'lib/rubyquartz/pdf_page.rb', line 38

def initialize(options)
  @document = options[:document] # Keep a reference to this since the CGPDFPageRef refers to its CGPDFDocumentRef but doesn't retain it.
  index = options[:index]
  if @document && index
    _initialize_with_document_at_index(@document, index)
    return
  end

  raise "Cannot determine how to create PDF page from given options"
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



28
29
30
# File 'lib/rubyquartz/pdf_page.rb', line 28

def document
  @document
end

Instance Method Details

#page_box(type) ⇒ Object



49
50
51
# File 'lib/rubyquartz/pdf_page.rb', line 49

def page_box(type)
  _page_box(@@BoxTypeToNumber[type])
end