AddNewPage

What it does

Adds a page image to a document.

Important! The added images will become accessible only after they are pre-processed. Use the ProcessBatch method to initiate batch processing after you have added the images. Another option is to use the CloseTask method to close the task and to send it at the Import stage if the images were added into the documents of a task that was opened with the OpenTask method.

Definition

int AddNewPage( int sessionId, int batchId, int documentId, int previousItemId, Page page, File file );

Parameters

Name Type Description
sessionId int The ID of the connection to the Application Server
batchId int The ID of the batch that contains the document
documentId int The ID of the document into which a page is to be added
previousItemId int

The ID allowing explicit specification of the position of the new page in the set:

  • -1 - the new page will be added at the end of the set
  • 0 - the new page will be added at the start of the set
  • Page ID - the new page will be added after the page with this ID
    Note: A page with this ID must exist.
page Page A description of the page. It is recommended to add pages with a predefined ID field
file File The file that contains the page image

Note: You can also use a POST request to add a new page from the file containing an image. To do this, create a page with an empty file using this method: (file.Name = "FileName", file.Bytes = new bytes [0]). Next, execute a POST request with the following parameters:

  • Action = Save
  • objectType = 1
  • objectId = documentId, where documentId represents the ID of the document, to which a page should be added
  • version = 0
  • streamName = "Page 1", where 1 represents the page ID returned by the AddNewPage method

Returned value

Type Description
int The ID of the added page

4/12/2024 6:16:02 PM

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.