Method: PaperlessOCR::PDFpen#ocr
- Defined in:
-
lib/paperless/ocr_engines/pdfpen.rb,
lib/paperless/ocr_engines/acrobat.rb
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/paperless/ocr_engines/pdfpen.rb', line 15 def ocr() begin doc = @app.open MacTypes::Alias.path([:file]) doc.ocr app("System Events").processes[@engine].visible.set(false) while doc.performing_ocr.get sleep 1 end doc.close(:saving => :yes) sleep 3 rescue puts "WARNING: There was an error OCRing the document with #{@engine}: #{$!}" end end |