Class: PdflibWrapper::Page
- Inherits:
-
Object
- Object
- PdflibWrapper::Page
- Defined in:
- lib/pdflib_wrapper/page.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
Returns the value of attribute page.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pdf, width, height, opts = {}) ⇒ Page
constructor
A new instance of Page.
- #save(opts = {}) ⇒ Object (also: #close)
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
#page ⇒ Object
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 (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.('', 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 |