This commit is contained in:
15
docs/snippets/ruby/getting-started/extract_with_ocr.md
Normal file
15
docs/snippets/ruby/getting-started/extract_with_ocr.md
Normal file
@@ -0,0 +1,15 @@
|
||||
```ruby title="Ruby"
|
||||
require 'kreuzberg'
|
||||
|
||||
ocr_config = Kreuzberg::OcrConfig.new(
|
||||
backend: 'tesseract',
|
||||
language: 'eng'
|
||||
)
|
||||
|
||||
config = Kreuzberg::ExtractionConfig.new(ocr: ocr_config)
|
||||
result = Kreuzberg.extract_file_sync('scanned.pdf', config: config)
|
||||
|
||||
puts "Extracted text from scanned document:"
|
||||
puts result.content
|
||||
puts "Used OCR backend: tesseract"
|
||||
```
|
||||
Reference in New Issue
Block a user