Sha256: 9911af27ec8107ddac3bd7f87fdf968f6bc0f106c040fcc8cdef3bdccb40b341

Contents?: true

Size: 342 Bytes

Versions: 45

Compression:

Stored size: 342 Bytes

Contents

require 'pdf-reader'

module Util
  class ExtractPdfText
    def initialize(pdf)
      @pdf = pdf
      @extracted_text = ''
      read_text
    end

    attr_reader :extracted_text

    def read_text
      reader = PDF::Reader.new(@pdf.path)
      reader.pages.each do |page|
        @extracted_text += page.text
      end
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
inspec_tools-3.1.0 lib/utilities/extract_pdf_text.rb
inspec_tools-3.1.0.pre1 lib/utilities/extract_pdf_text.rb
inspec_tools-3.0.0 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.8 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.7 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.6 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.5 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.4 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.3 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.2 lib/utilities/extract_pdf_text.rb
inspec_tools-2.3.1 lib/utilities/extract_pdf_text.rb
inspec_tools-2.2.0 lib/utilities/extract_pdf_text.rb
inspec_tools-2.1.0 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.7 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.6 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.5 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.4 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.3 lib/utilities/extract_pdf_text.rb
inspec_tools-2.0.2.pre13 lib/utilities/extract_pdf_text.rb
inspec_tools-0.0.0.1.ENOTAG lib/utilities/extract_pdf_text.rb