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 using this method. Instead, use the DeleteDocument method to delete the last page of a document. Fields values from the deleted page are cleared and the classification result of the document is retained. The page is deleted from the document and the document is 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). Alternatively, use the MovePageTo method to move a page to another document (pFromXDocInfo, pToXDocInfo). All attached data is moved with its page, including 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 the last page of a document. Instead, use the MergeDocuments method to move the last page of a document. The classification result of the document persists. If a page is moved within a document, that document is set to invalid. If a page is moved between documents both the source and the destination documents are marked 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)

you can copy a page (PageIndex) 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 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)

You can add a page 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 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)

You can rotate a page 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 configure rotation to use the Save image rotation on disk setting or the Save image rotation on XDocument setting in the Project Settings - General tab.

By default, the Save image rotation on disk setting 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.

Rotating a page deletes all OCR and field data 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 that you prohibit page rotation when there is a masked area defined on the corresponding validation form.