Module: TesseractFFI

Extended by:
FFI::Library
Included in:
Tesseract
Defined in:
lib/tesseract_ffi.rb,
lib/tesseract_ffi/oem.rb,
lib/tesseract_ffi/quick.rb,
lib/tesseract_ffi/version.rb,
lib/tesseract_ffi/conf_vars.rb,
lib/tesseract_ffi/tesseract.rb,
lib/tesseract_ffi/rectangles.rb,
lib/tesseract_ffi/tess_exception.rb

Overview

module with version

Defined Under Namespace

Modules: ConfVars, OEM, Rectangles Classes: FFIDoublePtr, FFIIntPtr, TessException, Tesseract

Constant Summary collapse

LEGACY =

OCR Engine Modes OEM

0
LTSM =
1
LEGACY_LTSM =
2
DEFAULT =
3
VERSION =
'0.7.0'

Class Method Summary collapse

Class Method Details

.to_pdf(in_file_name, out_file_root) ⇒ Object



11
12
13
14
15
# File 'lib/tesseract_ffi/quick.rb', line 11

def self.to_pdf(in_file_name, out_file_root)
  t = Tesseract.new(file_name: in_file_name)
  t.convert_to_pdf(out_file_root)
  t.utf8_text
end

.to_text(file_name, language = 'eng') ⇒ Object



5
6
7
8
9
# File 'lib/tesseract_ffi/quick.rb', line 5

def self.to_text(file_name, language = 'eng')
  t = Tesseract.new(file_name: file_name, language: language)
  t.recognize
  t.utf8_text
end