Code samples (H2)

The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network.

The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network. ABBYY Cloud OCR SDK provides a set of samples in different programming languages showing how to create a simple client application.

<div class="code"><pre>Long alone code line (very long... very very long... very very very long... much longer)</pre></div>

The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network. ABBYY Cloud OCR SDK provides a set of samples in different programming languages showing how to create a simple client application.

<response>
    <task id="c3187247-7e81-4d12-8767-bc886c1ab878%c3187247-7e81-4d12-8767-bc886c1ab878$c3187247-7e81-4d12-8767-bc886c1ab878"
        registrationTime="2012-02-16T06:42:09Z"
        statusChangeTime="2012-02-16T06:42:09Z"
        status="Queued"
        filesCount="1"
        credits="0"
        estimatedProcessingTime="1"
        description="Image.JPG to .pdf" />
</response>

Parameters

The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network. ABBYY Cloud OCR SDK provides a set of samples in different programming languages showing how to create a simple client application.

Start Debugging

Parameter Is required Default value Description
taskId No "", in this case a new task is created for the image Specifies the identifier of the task. If the task with the specified identifier does not exist or has been deleted, an error is returned.
pdfPassword No "" Contains a password for accessing password-protected images in PDF format.
Handprinted text type handprinted text type
Index text type index text type—digits written in ZIP-code style
E13b text type e13b text type—digits and A, B, C, D characters printed in magnetic ink

Code samples (H2)

  1. The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network.

  2. The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network. ABBYY Cloud OCR SDK provides a set of samples in different programming languages showing how to create a simple client application.

    • The Web API can be easily used in C#, Java, Python,

    • or any other development tool supporting communication over network.
    • ABBYY Cloud OCR SDK provides a set of samples in different programming languages

      Output pdf
    • showing how to create a simple client application.
    <div class="code"><pre>Long alone code line (very long... very very long... very very very long... much longer)</pre></div>
  3. The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network.

    <response>
        <task id="c3187247-7e81-4d12-8767-bc886c1ab878%c3187247-7e81-4d12-8767-bc886c1ab878$c3187247-7e81-4d12-8767-bc886c1ab878"
            registrationTime="2012-02-16T06:42:09Z"
            statusChangeTime="2012-02-16T06:42:09Z"
            status="Queued"
            filesCount="1"
            credits="0"
            estimatedProcessingTime="1"
            description="Image.JPG to .pdf" />
    </response>
  4. The Web API can be easily used in C#, Java, Python, or any other development tool supporting communication over network.

    Parameter Is required Default value Description
    taskId No "", in this case a new task is created for the image Specifies the identifier of the task. If the task with the specified identifier does not exist or has been deleted, an error is returned.
    pdfPassword No "" Contains a password for accessing password-protected images in PDF format.
Parameter Is required Default value Description
language No "English" Specifies recognition language of the document. This parameter can contain several language names separated with commas, for example "English,French,German". See the list of available recognition languages.
profile No "documentConversion" Specifies a profile with predefined processing settings. It can be one of the following:
  • documentConversion
  • documentArchiving
  • textExtraction
  • barcodeRecognition
textType No "normal" Specifies the type of the text on a page. This parameter may also contain several text types separated with commas, for example "normal,matrix". The following values can be used:
  • normal
  • typewriter
  • matrix
  • index
  • ocrA
  • ocrB
  • e13b
  • cmc7
  • gothic
imageSource No "auto"

Specifies the source of the image. It can be either a scanned image, or a photograph created with a digital camera. Special preprocessing operations can be performed with the image depending on the selected source. For example, the system can automatically correct distorted text lines, poor focus and lighting on photos.

The value of this parameter can be one of the following:

  • auto
    The image source is detected automatically.
  • photo
  • scanner
correctOrientation No "true" Specifies whether the orientation of the image should be automatically detected and corrected. It can have one of the following values:
  • true
    The page orientation is automatically detected, and if it differs from normal the image is rotated.
  • false
    The page orientation detection and correction is not performed.
correctSkew No "true" Specifies whether the skew of the image should be automatically detected and corrected. It can have either true or false value.
readBarcodes No "true" for xml export format and "false" in other cases Specifies whether barcodes must be detected on the image, recognized and exported to the result file. It can have either true or false value.
exportFormat No "rtf" Specifies the export format. This parameter can contain up to three export formats, separated with commas (example: "pdfa,txt,xml"). The available formats are:
  • txt
    The recognized text is exported to the file line by line from left to right. E.g. if the text was originally put in columns, the first lines of every column will be saved, then the second lines, etc.
    Please take into account the fact that in this format only text will be saved. No images or barcodes will remain in the output file. If you want to save the barcode recognition results in the exported file, use the txtUnstructured format.
  • txtUnstructured
    The exported file contains the text that was saved according to the order of the original blocks.
  • rtf
  • docx
  • xlsx
  • pptx
  • pdfSearchable
    The entire image is saved as a picture, the recognized text is put under it.
  • pdfTextAndImages
    The recognized text is saved as text, and the pictures are saved as pictures.
  • pdfa
    The file is saved in the PDF/A-1b format, with the entire image saved as a picture, and recognized text put under it.
  • xml
  • xmlForCorrectedImage
    The same as xml, but all coordinates written into the output XML file relate to the corrected image, not the original.
  • alto

If either of XML export formats is selected, barcodes are recognized on the image and saved to output XML no matter which profile is used for recognition.

Please note that setting multiple export formats does not affect the cost of task processing.

xml:writeFormatting No "false" Specifies whether the paragraph and character styles should be written to an output file in XML format. This parameter can be used only if the exportFormat parameter contains xml or xmlForCorrectedImage value. The parameter can have one of the following values:
  • true
  • false
xml:writeRecognitionVariants No "false" Specifies whether the variants of characters recognition should be written to an output file in XML format. This parameter can be used only if the exportFormat parameter contains xml or xmlForCorrectedImage value. The parameter can have one of the following values:
  • true
  • false
pdf:writeTags No "auto"

Specifies whether the result must be written as tagged PDF. This parameter can be used only if the exportFormat parameter contains one of the values for export to PDF. It can have one of the following values:

  • auto
    Automatic selection: the tags are written into the output PDF file if it must comply with PDF/A-1a standard, and are not written otherwise.
  • write
  • dontWrite
description No "" Contains the description of the processing task. Cannot contain more than 255 characters.
pdfPassword No "" Contains a password for accessing password-protected images in PDF format.