AddNewDocument
What it does
Adds a new document from an image file into a batch.
To create a document without an image, leave the file parameter empty (file.Name = "", file.Bytes = new bytes [0]).
A new document is created with the excludeFromAutomaticAssembling flag set to true. This flag indicates that the document has already been assembled, and the assembly settings specified for the batch type will not be applied to this document.
Wichtig! Newly added documents become accessible only after their images are pre-processed. Use the ProcessBatch method to initiate batch processing after adding new documents.
Hinweis. When anew document is added into the batch, the Id field of the corresponding object must not be empty.
If you are adding PDF documents and want the program to use the text stored in their text layer, make sure that the Use PDF text layer instead of OCR option is selected for the project in which the documents will be processed (you can find this option on the Processing tab of the Page Properties dialog box).
Definition
int AddNewDocument( int sessionId, Document document, File file, bool excludeFromAutomaticAssembling, int previousItemId );
Parameters
Name | Type | Description |
sessionId | int | The ID of the connection to the Application Server |
document | Document | A description of the document that is being created |
file | File | The file that contains the document image |
excludeFromAutomaticAssembling | bool |
A flag that shows whether the document is excluded from document assembly or not:
|
previousItemId | int |
The ID explicitly specifying the position of the new document in the set:
|
Hinweis. You can also use a POST request to add document image. For this, create a document with an empty file by this method (file.Name = "FileName", file.Bytes = new bytes [0]). Then execute a POST request with the following parameters:
- Action = Save
- objectType = 0
- objectId = documentId, where documentId document ID returned by the AddNewDocument method
- version = 0
- streamName = "FileName", where FileName is a name of the file specified when calling the AddNewDocument method
Returned value
Type | Description |
int | The ID of the created document |
4/12/2024 6:16:01 PM