Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
Abbyy Cloud OCR SDK Client for Crystal.
Based on abbyy-client-php.
Add this to your application's
dependencies: abbyy: github: TamasSzekeres/abbyy-client.cr
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.
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
This package is released under the MIT License.