Newer Version Available
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 52.0 and later.
Special Access Rules
To use this metadata type, your Salesforce org must have the AWSTextract1000LimitAddOn 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. |
Represents the details of the field in a form whose value is extracted and mapped to a Salesforce object field.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| 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. |
| keyContent | string | Required. The content located 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. |
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.
Fields
| 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. |
| 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. |
Declarative Metadata Sample Definition
The following is an example of a OcrSampleDocument component.
1<?xml version="1.0" encoding="UTF-8"?>
2<OcrSampleDocument xmlns="http://soap.sforce.com/2006/04/metadata">
3 <contentAsset>asset_01jpeg</contentAsset>
4 <documentHeight>1.24</documentHeight>
5 <documentType>Form</documentType>
6 <masterLabel>Form</masterLabel>
7 <ocrSampleDocumentFields>
8 <fieldLabelMaxX>0.8</fieldLabelMaxX>
9 <fieldLabelMaxY>0.9</fieldLabelMaxY>
10 <fieldLabelMinX>0.7</fieldLabelMinX>
11 <fieldLabelMinY>0.5</fieldLabelMinY>
12 <keyContent>T</keyContent>
13 <ocrSampleDocument>Form</ocrSampleDocument>
14 <ocrSampleDocumentPage>1</ocrSampleDocumentPage>
15 </ocrSampleDocumentFields>
16 <ocrSampleDocumentFields>
17 <keyContent>Test_</keyContent>
18 <ocrSampleDocument>Form</ocrSampleDocument>
19 <ocrSampleDocumentPage>1</ocrSampleDocumentPage>
20 </ocrSampleDocumentFields>
21 <ocrSampleDocumentPages>
22 <ocrSampleDocument>Form</ocrSampleDocument>
23 <pageHeight>1.0</pageHeight>
24 <pageNumber>1</pageNumber>
25 </ocrSampleDocumentPages>
26 <ocrSampleDocumentPages>
27 <ocrSampleDocument>Form</ocrSampleDocument>
28 <pageNumber>2</pageNumber>
29 </ocrSampleDocumentPages>
30</OcrSampleDocument>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>DocumentType</name>
6 </types>
7 <types>
8 <members>*</members>
9 <name>ContentAsset</name>
10 </types>
11 <types>
12 <members>*</members>
13 <name>OcrSampleDocument</name>
14 </types>
15 <version>52.0</version>
16</Package>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.