Cloud OCR SDK Documentation

processBusinessCard Method

The method allows you to recognize a business card on an image. The method loads the image, creates a processing task for the image with the specified parameters, and passes the task for processing.

[POST] http(s)://cloud.ocrsdk.com/processBusinessCard

The image file is transmitted in the request body. See the list of supported input formats.

For details on task cost please see billing terms.

Parameters

ParameterIs requiredDefault valueDescription
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.
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.
exportFormat No "vCard"

Specifies the export format. It can be one of the following:

  • vCard
  • csv
  • xml
xml:writeExtendedCharacterInfo No "false" Specifies whether the additional information on the recognized characters (e.g. whether the character is recognized uncertainly) should be written to an output file in XML format. This parameter can be used only if the exportFormat parameter is set to xml. The parameter can have one of the following values:
  • true
  • false
xml:writeFieldComponents No "false"

Specifies whether the field components should be written to an output file in XML format. For example, for the Name field the components can include first name and last name, returned separately.

This parameter can be used only if the exportFormat parameter is set to xml. The parameter can have one of the following values:

  • true
  • false
description No "" Contains the description of the processing task. Must contain no more than 255 characters.
pdfPassword No "" Contains a password for accessing password-protected images in PDF format.

Status codes and response format

General status codes and response format of the method are described in HTTP Status Codes and Response Formats.

The following status codes can be returned when this method is called:

CodeDescription
200 Successful method call.
450 Incorrect parameters have been passed. One of the following errors occurred:
  • Image file has not been specified.
  • Incorrect recognition language has been specified.
  • Incorrect export format has been specified.
  • Task description length exceeds 255 characters.
  • Incorrect password for accessing password-protected image file has been specified.
  • Exceeded quota to add images. This error is returned if the number of images you have uploaded exceeds the number of images you can process with the credits available on your account plus some threshold. You can resolve this issue by topping up your account or by removing the tasks which have been submitted but have not been processed.
550 An internal program error occurred while processing the image.
551 An error occurred on the server side:
  • The format of the image file passed for processing is not supported.
  • The PDF file passed for processing has restrictions on creating raster images.

Output file format

If the exportFormat parameter is set to XML, the result of processing is returned in an XML file of the following format:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd" xmlns="http://ocrsdk.com/schema/recognizedBusinessCard-1.0.xsd">
  <businessCard>
    <field type="Phone">
      <value>783-37-00</value>
    </field>
    <field type="Fax">
      <value>783-26-63</value>
    </field>
    <field type="Email">
      <value>john_sm@abbyy.com</value>
    </field>
    <field type="Web">
      <value>www.abbyy.com</value>
    </field>
    <field type="Address">
      <value>Otradnaya str., 2b, bld.6, 127273, Moscow, Russia</value>
    </field>
    <field type="Name">
      <value>John Smith</value>
    </field>
    <field type="Company">
      <value>ABBYY Headquarters</value>
    </field>
    <field type="Job">
      <value>Product Analyst</value>
    </field>
    <field type="Text">
      <value>ABBYY ABBYY Headquarters John Smith Product Analyst ABBYY Headquarters Otradnaya str., 2b, bld.6, 127273, Moscow, Russia Tel: 783-37-00 Fax: 783-26-63 john_sm@abbyy.com www.abbyy.com </value>
    </field>
  </businessCard>
</document>

See the XSD scheme of an XML file.

Description of business card fields

Below you can see the list of the fields which can be recognized on a business card. Some of the fields can also contain field components (such as zip code and city for the address).

Field namePossible componentsDescription
Name FirstName
LastName
MiddleName
ExtraName
The person's name.
Phone PhonePrefix
PhoneCountryCode
PhoneCode
PhoneBody
PhoneExtension
The phone number.
Mobile PhonePrefix
PhoneCountryCode
PhoneCode
PhoneBody
PhoneExtension
The mobile phone number.
Fax PhonePrefix
PhoneCountryCode
PhoneCode
PhoneBody
PhoneExtension
The fax number.
Company The company's name.
Job JobPosition
JobDepartment
The person's position in the company.
Address ZipCode
Country
City
StreetAddress
This can be the company's address or the personal address.
Email The e-mail address.
Web The company's or personal website.
Text This field contains all the text recognized on the business card.