Class: PdflibWrapper::External::Pdf::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/pdflib_wrapper/external/pdf/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf, filepath, opts = {}) ⇒ Document

Returns a new instance of Document.



6
7
8
9
10
11
12
# File 'lib/pdflib_wrapper/external/pdf/document.rb', line 6

def initialize(pdf, filepath, opts={})
	#TODO: support opts
	key_values = [:password]
	singles = []
	@pdf = pdf
	@document = @pdf.open_pdi_document( filepath, OptionListMapper.create_options('', key_values, singles, opts) )
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



5
6
7
# File 'lib/pdflib_wrapper/external/pdf/document.rb', line 5

def document
  @document
end

Instance Method Details

#closeObject



19
20
21
22
# File 'lib/pdflib_wrapper/external/pdf/document.rb', line 19

def close
	#TODO: support opts
	@pdf.close_pdi_document(@document)
end

#open_page(page_number = 1, opts = {}) ⇒ Object



14
15
16
17
# File 'lib/pdflib_wrapper/external/pdf/document.rb', line 14

def open_page(page_number=1, opts={})
	#TODO: support opts
	External::Pdf::Page.new(@pdf, self, page_number, "" )
end