Sha256: 50447b51d58e5bd144174e4e4e9b193a3cd0e3684fa315711e44adc0fc8db4fc

Contents?: true

Size: 305 Bytes

Versions: 1

Compression:

Stored size: 305 Bytes

Contents

class String
  def strip_space
    gsub(/\s/, '')
  end
end

def pdf_to_text(file)
  pdf = PDF::Toolkit.open(file)
  pdf.to_text.read.force_encoding('ascii-8bit')
end

def pdf_stream_to_text(bytes)
  pdf = Tempfile.new('pdf', :encoding => 'ascii-8bit')
  pdf.write bytes
  pdf.close
  pdf_to_text pdf
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
medivo-0.1.8 spec/support/helper.rb