Class: PdflibWrapper::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/pdflib_wrapper/page.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf, width, height, opts = {}) ⇒ Page

Returns a new instance of Page.



4
5
6
7
8
# File 'lib/pdflib_wrapper/page.rb', line 4

def initialize(pdf, width, height, opts={})
	#TODO: support opts
	@pdf = pdf
	@page = @pdf.begin_page_ext(width, height, "")
end

Instance Attribute Details

#pageObject

Returns the value of attribute page.



3
4
5
# File 'lib/pdflib_wrapper/page.rb', line 3

def page
  @page
end

Class Method Details

.embed(pdf, page, x, y, opts) ⇒ Object



17
18
19
20
# File 'lib/pdflib_wrapper/page.rb', line 17

def embed(pdf, page, x, y, opts)
 	key_values = [:dpi, :boxsize, :rotate, :blind, :matchbox, :orientate, :position, :showborder, :fitmethod]
	pdf.fit_pdi_page(page.page, x, y, OptionListMapper.create_options('', key_values, [], opts))
end

Instance Method Details

#save(opts = {}) ⇒ Object Also known as: close



10
11
12
13
# File 'lib/pdflib_wrapper/page.rb', line 10

def save(opts={})
	#TODO: support opts
	@pdf.end_page_ext("")  
end