module Pdf::Textstream

Constants

PDDocument
PDFLayoutTextStripper
PDFParser

change namespace

PDFTextStripper
RandomAccessFile
VERSION

Public Class Methods

file_path_to_text(path) click to toggle source
# File lib/pdf/textstream.rb, line 20
def self.file_path_to_text(path)
  # TODO: exception handling
  pdfParser = PDFParser.new(RandomAccessFile.new(Java::JavaIo::File.new(path), "r"))
  pdfParser.parse()
  pdDocument = PDDocument.new(pdfParser.getDocument());
  pdfTextStripper = PDFLayoutTextStripper.new
  string = pdfTextStripper.getText(pdDocument);
  return string
end