Class: HtmlFromPdf::Converter

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/html_from_pdf/converter.rb

Instance Method Summary collapse

Methods included from Helpers

#create_dir, #default_file_path

Constructor Details

#initialize(pdf_path, html_path, options = {}) ⇒ Converter

Returns a new instance of Converter.



5
6
7
8
9
# File 'lib/html_from_pdf/converter.rb', line 5

def initialize(pdf_path, html_path, options = {})
  @pdf_path = pdf_path
  @html_path = html_path
  @options = options
end

Instance Method Details

#convertObject



11
12
13
14
15
# File 'lib/html_from_pdf/converter.rb', line 11

def convert
  file_name = process_html_path
  command = "pdf2htmlEX #{options} #{@pdf_path} #{file_name}"
  raise HtmlFromPdf::ConvertingError unless system command
end