To get started, load the package. The latest version of the package will always be on github. Instructions for installing the package from github are provided below.
library(abbyyR)"
Get the latest version from github:
# install.packages('devtools')
devtools::install_github('soodoku/abbyyR')
"Your first task on loading the package should be to set the credentials - application ID and password. If you haven’t already, you can get this information http://ocrsdk.com/. Once you have the application ID and password, set it via the setapp function.
setapp(c("factbook", "7YVBc8E6xMricoTwp0mF0aH"))getAppInfo()## Name of Application: factbook
## No. of Pages Remaining: 99
## No. of Fields Remaining: 495
## Application Credits Expire on: 2015-08-28T00:00:00
## Type: NormalList all the tasks – completed, in progress, queued etc. The function returns a data frame.
tasklist <- listTasks()## Total No. of Tasks:  30 
## No. of Finished Tasks:  22listTasks(excludeDeleted="true")## Total No. of Tasks:  28 
## No. of Finished Tasks:  22listTasks(fromDate="2015-05-30T20:28:43Z", toDate="2015-05-31T20:28:43Z")## No tasks in the application.listFinishedTasks()## No. of Finished Tasks:  24getTaskStatus(taskId="47f9b0d4-79a2-4aed-b656-2683a85ac203")## Status of the task:  DeletedDeleting an already deleted task will result in an error.
#deleteTask(taskId="47f9b0d4-79a2-4aed-b656-2683a85ac203")Submit an Image for Processing
Note: I am uploading a sample image that Abbyy provides for free to test its software. You can find this image in the data folder of the package.
submitImage(file_path="t1.tif", pdfPassword="")## Status of the task:  Submitted 
## Task ID:  4c088272-003d-4fc7-b0f7-b805495c4466Process an Image
processImage(file_path="t1.tif")## Status of the task:  Queued 
## Task ID:  650d4cd3-964c-40c6-9118-97eecc099b34Process a Remote Image
processRemoteImage(img_url="https://raw.githubusercontent.com/soodoku/abbyyR/master/inst/extdata/t1.TIF")## Status of the task:  Submitted 
## Task ID:  7f5112b8-6541-435e-86c4-dc978a45749eProcess Document
res <- listTasks()## Total No. of Tasks:  33 
## No. of Finished Tasks:  23processDocument(taskId=res$id[res$status=="Submitted"][1])## Status of the task:  QueuedGet Results
Go through all the finished tasks and download all the data.
# getResults()