Page operations

The following Batch restructuring operations are available for pages. Any parameters are in parentheses.

Delete a Page

Batch.DeletePage (ByVal pXDocInfo As CscXDocInfo, ByVal PageIndex As Long)

By calling this method the specified page is deleted from the given document (pXDocInfo). It is not possible to delete the last page from a document; for this use the DeleteDocument method. Fields that are supplied from the deleted page are cleared. The classification result of the document is kept. The document the page is deleted from is initially set to invalid.

Move a Page

Batch.MovePage (ByVal pXDocInfo As CscXDocInfo, ByVal FromPageIndex As Long, ByVal ToPageIndex As Long)

Batch.MovePageTo (ByVal pFromXDocInfo As CscXDocInfo, ByVal FromPageIndex As Long, ByVal pToXDocInfo As CscXDocInfo, ByVal ToPageIndex As Long)

A page (FromPageIndex) can be moved inside a document ( pXDocInfo) or via MovePageTo moved to another document (pFromXDocInfo, pToXDocInfo). All data attached is moved along with that page such as OCR results. When moving the page to a different document this data is no longer available in the source document, so fields may loose their results if they are connected to these pages. You cannot move out the last page of a document, for doing this use the MergeDocuments method. The classification result of the document persists. Initially the document where a page is moved internally or both documents the source and the destination document if moving outside are getting invalid.

Copy a Page

Batch.CopyPage (ByVal pXDocInfo As CscXDocInfo, ByVal FromPageIndex As Long, ByVal ToPageIndex As Long)

Batch.CopyPageTo (ByVal pFromXDocInfo As CscXDocInfo, ByVal FromPageIndex As Long, ByVal pToXDocInfo As CscXDocInfo, ByVal ToPageIndex As Long)

A page (FromPageIndex) can be copied inside of a document (pXDocInfo) or via CopyPageTo copied to another document (pToXDocInfo) by specifying its new position (ToPageIndex). The data attached to the copied page is duplicated and inserted into the target document. The initial status of the target document is invalid and its classification result persists.

Batch.CopyPageToNewDocument(ByVal pXDocInfo As CscXDocInfo, ByVal PageIndex As Long, ByVal pToXFolder As CscXFolder, ByVal ToDocIndexInFolder As Long)

A page (PageIndex) can be copied to a new document by specifying the position of the new document in the given folder. The data attached to the copied page is duplicated and inserted into the new document. The initial status of the new document is invalid and unclassified.

Add a Page

Batch.AddPage (ByVal pXDocInfo As CscXDocInfo, ByVal SourceFilename As String, ByVal FileType As CscXDocSourceFileType, ByVal ToPageIndex As Long)

A page can be added to a document (pXDocInfo) by specifying its new position (ToPageIndex) that is of an supported file type. Source files containing multiple pages are not supported. The initial status of the target document is invalid and its classification result persists.

Rotate a Page

Batch.RotatePage (ByVal pXDocInfo As CscXDocInfo, ByVal RotationType As CscXDocRotationTypeEnum, ByVal PageIndex As Long)

A page can be rotated by specifying a rotation type. The rotation type determines whether the source image of a rotated page is physically changed by storing the result on disk or the image stays unchanged and instead the result is stored within the XDocument only. In Project Builder you can set the option Save image rotation on disk, and respectively Save image rotation on XDocument in the Project Settings - General tab globally for a project.

By default, Save image rotation on disk is selected so that the result is saved on disk. If Save image rotation on XDocument is selected, the result is stored within the XDocument. However, when rotating a page of a PDF document the result is always stored within the XDocument because PDF documents are read-only.

Important Rotating a page deletes all OCR and field results for that page and sets the status of the document to invalid. Rotating a page is applicable even if the page has a masked area defined. In addition, for a page that has one or more annotations attached those are rotated as well.

Note that we highly recommend to prohibit the rotation of a page that has a masked area defined on the corresponding validation form.