Class: BaaChan::PdfToText
- Inherits:
-
Object
- Object
- BaaChan::PdfToText
- Defined in:
- lib/baa_chan/pdf_to_text.rb
Class Method Summary collapse
Class Method Details
.call(source) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/baa_chan/pdf_to_text.rb', line 11 def self.call(source) raise InvalidExtensionError unless source.match /\.pdf$/ content = `pdftotext -layout #{source} -` raise UnreadablePDFError unless $CHILD_STATUS.success? content end |