OcrSampleDocument
The OcrSampleDocument type doesn’t need to represent a real sample document. It can also be an abstract document that represents all documents of the same DocumentType. In such cases, the contentAsset and documentHeight fields are null.
File Suffix and Directory Location
OcrSampleDocument components have the suffix .ocrSampleDocument and are stored in the ocrSampleDocuments folder.
Version
OcrTemplate components are available in API version 55.0 and later.
Special Access Rules
To use this metadata type, your Salesforce org must have the AWSTextract1000LimitAddOn or IntelligentDocumentReaderAddOn license.
Fields
Field Name | Field Type | Description |
---|---|---|
contentAsset | string | The ID of the OCR sample document asset. |
documentHeight | double | The normalized height of the OCR sample document page. |
documentType | string | Required. The type of the OCR sample document. |
masterLabel | string | Required. The label for the OCR sample document. |
ocrSampleDocumentFields | OcrSampleDocumentField[] | The details of the field in a form whose value is extracted and mapped to a Salesforce object field. |
ocrSampleDocumentPages | OcrSampleDocumentPage[] | A collection of fields that define a page in the OCR sample document. |
OcrSampleDocumentField
Represents the details of the field in a form whose value is extracted and mapped to a Salesforce object field.
Field Name | Field Type | Description |
---|---|---|
cellColumnNumber | int | The column number in the item with the cell storing this field’s value. Available in API version 56.0 and later. |
cellColumnSpanValue | int | The number of columns that span the cell storing this field’s value. Available in API version 56.0 and later. |
cellRowNumber | int | The row number in the item with the cell storing this field’s value. Available in API version 56.0 and later. |
cellRowSpanValue | int | The number of rows that span the cell storing this field’s value. Available in API version 56.0 and later. |
fieldLabelMaxX | double | A normalized coordinate representing the right edge of the bounding box of the key. |
fieldLabelMaxY | double | A normalized coordinate representing the bottom edge of the bounding box of the key. |
fieldLabelMinX | double | A normalized coordinate representing the left edge of the bounding box of the key. |
fieldLabelMinY | double | A normalized coordinate representing the top edge of the bounding box of the key. |
fieldValueName | string | Name of the referred field value. Available in API version 56.0 and later. |
isAutoExtractedValue | boolean | Indicates whether the key is automatically extracted (true) or not (false). Available in API version 57.0 and later. |
keyContent | string | The content in a particular area of the form, representing the field that is extracted by OCR. |
ocrSampleDocument | string | Required. The associated OCR sample document used as a reference while extracting and mapping information from a customer form. |
ocrSampleDocumentPage | string | A reference to a page of the OCR sample document that contains the key. |
ocrSampleDocumentPageItem | OcrSampleDocumentPageItem[] | A reference to the item on the sample document page containing this field's value. Available in API version 56.0 and later. |
OcrSampleDocumentPage
Represents a collection of fields that define a page in the OCR sample document. This type exists only if the OcrSampleDocument is a real sample document and not an abstract document representing the DocumentType.
Field Name | Field Type | Description |
---|---|---|
ocrSampleDocument | string | Required. The associated OCR sample document used as a reference while extracting and mapping information from a customer form. |
ocrSampleDocumentPageItems | OcrSampleDocumentPageItem[] | The collection of page items with the associated OCR sample document page. Available in API version 56.0 and later. |
pageHeight | double | The normalized height of the OCR sample document page. |
pageNumber | integer | Required. The page number of the page in the associated OCR sample document. |
OcrSampleDocumentPageItem
Represents a foreign key reference to the item on the sample document page containing a value for the page item.
Field Name | Field Type | Description |
---|---|---|
hasHeader | boolean | Indicates whether the OCR sample document page item has a header (true) or not (false). The default value is false. Available in API version 56.0 and later. |
sequenceNumber | int | Required. The sequence number of the item on an OCR sample document page with multiple items. Available in API version 56.0 and later. |
title | string | The title of the OCR sample document page item. Available in API version 56.0 and later. |
type | ItemType (enumeration of type string) | Required. Specifies the type of OCR sample document page item. Valid value is TABLE. Available in API version 56.0 and later. |
Declarative Metadata Sample Definition
The following is an example of a OcrSampleDocument component.
<?xml version="1.0" encoding="UTF-8"?>
<OcrSampleDocument xmlns="http://soap.sforce.com/2006/04/metadata">
<contentAsset>asset_01jpeg</contentAsset>
<documentHeight>1.24</documentHeight>
<documentType>Form</documentType>
<masterLabel>Form</masterLabel>
<ocrSampleDocumentFields>
...<cellColumnNumber>1</cellColumnNumber>
<cellColumnSpanValue>1</cellColumnSpanValue>
<cellRowNumber>1</cellRowNumber>
<cellRowSpanValue>1</cellRowSpanValue>
<fieldLabelMaxX>0.5975854</fieldLabelMaxX>
<fieldLabelMaxY>0.46625894</fieldLabelMaxY>
<fieldLabelMinX>0.5065626</fieldLabelMinX>
<fieldLabelMinY>0.39605626</fieldLabelMinY>
<keyContent>Last Name</keyContent>
<ocrSampleDocument>image240</ocrSampleDocument>
<ocrSampleDocumentPage>1</ocrSampleDocumentPage>
<ocrSampleDocumentPageItem>
<hasHeader>false</hasHeader>
<sequenceNumber>1</sequenceNumber>
<title>Table1</title>
<type>TABLE</type>
</ocrSampleDocumentPageItem>
</ocrSampleDocumentFields>
<ocrSampleDocumentPages>
<ocrSampleDocument>Form</ocrSampleDocument>
<pageHeight>1.0</pageHeight>
<pageNumber>1</pageNumber>
</ocrSampleDocumentPages>
<ocrSampleDocumentPages>
<ocrSampleDocument>Form</ocrSampleDocument>
<pageNumber>2</pageNumber>
</ocrSampleDocumentPages>
</OcrSampleDocument>
The following is an example package.xml that references the previous definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>DocumentType</name>
</types>
<types>
<members>*</members>
<name>ContentAsset</name>
</types>
<types>
<members>*</members>
<name>OcrSampleDocument</name>
</types>
<version>64.0</version>
</Package>