IDocument

What it does

Represents a document.

Note. Some methods and properties of this object are not available on the Web Verification Station for checking rules locally. The methods and properties that are not supported are marked with an asterisk (*).

Methods

Definition Description
AddFileToExportResults( sourceFile : string, destinationName : string, replaceIfExists : bool ) *

Adds a user file to document export results.

In the sourceFile parameter, specify the address of the user file to be added.

Note: Be sure to specify the root export path in the project settings. Otherwise, the user file will be placed into the batch folder in the file storage location.

In the destinationName parameter, specify an export destination.

Set the replaceIfExists parameter to true if you want to overwrite any existing file with the same name in the destination. Set the replaceIfExists parameter to false if you want to keep any existing file with the same name in the destination and add an error message to the log.

CheckRules( ) * Checks all rules in the document. Write permissions for the document are required.
Field( name : string ) : IField *

Gets access to a document field by the full path to the field. Full paths are used.

Is an internal** field. Cannot be used in rules.

HasField( name : string ) : bool *

Checks whether a field with the specified path exists. Relative paths are used.

Is an internal** field. Cannot be used in rules.

IndexedItemValue( name : string ) : VARIANT * Retrieves the field value by the name or the path to the field. Available from external fields of documents and pages. Both a field name and a full path to the field can be used. Cannot be used in rules.
IndexedItemValues( name : string ) : IVARIANTArray * Retrieves a set of index values corresponding to a field in the Document Definition by the name or the path to the field. If a field is marked as an index field in the recurring section, the method returns all values of the field from all sections. Available from external fields of documents and pages. Both a field name and a full path to the field can be used. Cannot be used in rules.
Property( name : string ) : VARIANT

Retrieves the value of a specified property by its name. The returned value can be in the form of a string, a number or time.

Properties names and returned values:

  • Exported - when the document was exported
  • ExportedBy - who exported the document
  • Created - when the document was created
  • CreatedBy - who created the document
  • Recognized - when the document was recognized
  • RecognizedBy - who recognized the document
  • Modified - when the document was modified last
  • ModifiedBy - who modified the document
  • TotalSymbolsCount - the total number of symbols
  • UncertainSymbolsCount - the total number of uncertain symbols
  • RecognizedSymbolsCount - the number of recognized symbols
  • Comment - the comment on the document
  • ProcessingErrors - document processing errors
  • ProcessingWarnings - document processing warnings
  • Verified - the time when the fields of the documents were last edited manually
  • VerifiedBy - the user who made the last manual changes to the fields of the document (does not save information from Processing Stations)
SaveAs( filename : string, [optional] options : IExportImageSavingOptions ) * Saves the image of a one-page or multi-page document. If no saving format is specified in the saving options, the image is saved in a *.tif file. This is an internal** field.
SaveAsStream( [optional] options: IExportImageSavingOptions) : byte[] *

Saves the document to a memory stream and returns it as a byte array (COM SafeArray).

Note: JScript and VBScript do not support iteration over this array.

SaveXmlToFile( filename : string ) * Saves the XML file with the description of the document without preprocessing to the specified location to be used in the Web Verification Station.
SaveXmlToFileStorage() * Saves the XML file with the description of the document without preprocessing to the file storage to be used in the Web Verification Station.

Important! The Property method should not be confused with the Properties collection which contains document properties specified by the user.

Properties

Name Type Access Description
Action * IActionResult Read-only Is effective in export and post export scripts only.
AsBatchItem * IBatchItem Read-only Converts the document into an IBatchItem object.
AssemblingErrors IAssemblingErrors Read-only A collection of assembly errors. Access to the collection is always read-only.
Attachments IUserAttachments Read-only User attachments
Batch IBatch Read-only The batch. Irrespective of permissions of the script for the document, access to the batch is read-only and internal** fields of documents and pages are unavailable.
BatchName string Read-only The batch name.
Children * IFields Read-only

Child fields (document sections). Unlike the property Sections, section order corresponds to their order in Document Definition. Recurring sections are represented as one item and the instances are available through the Items method of that item.

Is an internal** field. Cannot be used in rules.

Comment string Read/write A comment of the document.
DefinitionName string Read-only

The name of the Document Definition.

For unprocessed and unrecognized documents, the property returns an empty string.

DocumentDefinition IDocumentDefinitionInfo Read-only Detailed information about the Document Definition which is matched on the document.
HasErrors bool Read-only Specifies whether the document has single-field or multi-field errors.
HasUnpreparedImages bool Read-only Specifies whether the document contains un-preprocessed pages.
HasWarnings bool Read-only Specifies whether the document has rule or format warnings.
Id string Read-only Document identifier (External Id). The value starts with 1 and is unique only within one batch.
Index int Read-only The index of the document in the batch. The value starts with 0 and is unique only within one task.
IsAnalyzed bool Read-only Specifies whether the document is analyzed. The document is considered analyzed if all pages of the document are analyzed.
IsAssembled bool Read-only Specifies whether the document is assembled.
IsExcludedFromAutomaticAssembling bool Read/write Checks if the document is included into automatic assembly.
IsExported bool Read-only Specifies whether the document is exported.
IsRecognized bool Read-only Specifies whether the document is recognized. The document is considered recognized if each page of the document is either recognized or this is an annex page.
IsUsedForTraining bool Read/write Specifies whether the document is used for training.
IsVerified bool Read-only Specifies whether the document is verified.
Pages IPages Read-only Document pages.
PreviousStageInfo * IStageInfo Read-only Returns the IStageInfo object, i.e. the processing stage of the document. The TaskId and PrincipalId fields are not used.
Priority TProcessingPriority Read-only A priority of the document.
ProcessingErrors * string Read-only Processing errors divided by line breaks.
ProcessingWarnings * string Read-only Processing warnings divided by line breaks.
ProhibitedUserId * int Read-only A task created from the document will not be available to the user with the given identifier. By default the value is "0" which means that the task is available to all users.
Properties IProperties Read-only Registration parameters of the document.
RecognizedSymbolsCount * int Read-only The number of recognized symbols.
RuleErrors * IRuleErrors Read-only

A collection of document errors (format errors, rule errors, errors of merging double verification results).

Note: Available for open documents only.

Sections * IFields Read-only

A flat list of document sections. If there is a recurring section, the list contains all replications of the section. Sections in the list go in the same order as the first pages of the document sections. Sections without pages close the list.

Is an internal** field. Cannot be used in rules.

StageInfo IStageInfo Read-only Information about the processing stage on the application server.
SymbolsForVerificationCount int Read-only The number of symbols that need verification.
TotalSymbolsCount int Read-only The total number of symbols.
UncertainSymbolsCount int Read-only The number of uncertain symbols.

** - The internal field requires loading the object into memory.

25.05.2023 7:55:02

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.