Class: Proselytism::Converters::PdfToText

Inherits:
Base
  • Object
show all
Defined in:
lib/proselytism/converters/pdf_to_text.rb

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Methods inherited from Base

#convert, #destination_file_path, #execute

Instance Method Details

#perform(origin, options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/proselytism/converters/pdf_to_text.rb', line 7

def perform(origin, options={})
  destination = destination_file_path(origin, options.update(:to => :txt))
  command = "pdftotext -enc UTF-8 #{origin} #{destination} 2>&1"
  execute command
  destination
end