abbyy-client.cr
Abbyy Cloud OCR SDK Client for Crystal.
Installation
Add this to your application's shard.yml
:
dependencies:
abbyy:
github: light-side-software/abbyy-client.cr
Then run:
crystal deps
Authentication
If you want to use the api, you have to register on Abbyy's site and create an application to get your own application_id and password.
Usage
require "abbyy"
module AbbySample
include Abbyy
include Abbyy::Models
APPLICATION_ID = "_YOUR_APPLCATION_ID_"
PASSWORD = "_YOUR_PASSWORD_"
def self.main
input_file = "ScannedDocument.png"
output_file = "SearchableDocument.pdf"
client = Client.new(APPLICATION_ID, PASSWORD)
request = ProcessImageRequest.new(
file_path: input_file,
image_source: ImageSource::Scanner,
export_format: ExportFormat::PdfTextAndImages)
# - Send the image to API
# - Wait for processing
# - Finally download and return the result
result = client.perform_image_processing request
# Saving result to file.
if task_result = result.as?(TaskResult)
unless task_result.result.is_a? Nil
task_result.save_result output_file
end
end
0
end
main
end
Resources
- API reference: ocrsdk.com/documentation/apireference/
- Online Documentation: https://light-side-software.github.io/abbyy-client.cr/.
License
This package is released under the MIT License.
Contributing
- Fork it ( https://github.com/light-side-software/abbyy-client.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- TamasSzekeres Tamás Szekeres - creator, maintainer