Class DocumentEditor

Inheritance
System.Object
DocumentEditor
Namespace: PSPDFKit
Assembly: PSPDFKit.dll
Syntax
public class DocumentEditor : object

Constructors

DocumentEditor()

Create a instance of the document editor working on a blank document with 0 pages.

Declaration
public DocumentEditor()

Methods

AddOperations(JArray)

Form a custom operation from JSON and append to the operations to be performed. For information on how to form an operation, please see https://pspdfkit.com/guides/web/current/features/document-editor/#operations.

Declaration
public void AddOperations(JArray jsonArray)
Parameters
Type Name Description
JArray jsonArray

An array of operations to perform.

AddPage(Int32, DocumentEditor.IndexPosition, Int32, Int32, Rotation, Color, Insets)

Add a single new page with the given configuration.

Declaration
public void AddPage(int pageIndex, DocumentEditor.IndexPosition indexPosition, int height, int width, Rotation rotation, Color color, Insets insets)
Parameters
Type Name Description
System.Int32 pageIndex

The index in which to place the new page.

DocumentEditor.IndexPosition indexPosition

Place the page before or after the given page index.

System.Int32 height

The height of the new page.

System.Int32 width

The width of the new page.

Rotation rotation

The rotation of the new page in 90 degree increments.

Color color

The background color of the new page.

Insets insets

The edit insets for the new page.

ClearPageLabels()

Clear labels from all of the pages.

Declaration
public void ClearPageLabels()

DuplicatePages(IEnumerable<Int32>)

Duplicate and insert after the referenced page indices.

Declaration
public void DuplicatePages(IEnumerable<int> pageIndices)
Parameters
Type Name Description
IEnumerable<System.Int32> pageIndices

The pages to duplicate.

ImportDocument(Int32, DocumentEditor.IndexPosition, IDataProvider)

Import a document from another data source and insert into the document.

Declaration
public void ImportDocument(int pageIndex, DocumentEditor.IndexPosition indexPosition, IDataProvider importDocument)
Parameters
Type Name Description
System.Int32 pageIndex

The index to insert the document into.

DocumentEditor.IndexPosition indexPosition

Place the page before or after the given page index.

IDataProvider importDocument

The document to import.

KeepPages(IEnumerable<Int32>)

Keep all the pages referenced and remove the remaining.

Declaration
public void KeepPages(IEnumerable<int> pageIndices)
Parameters
Type Name Description
IEnumerable<System.Int32> pageIndices

Pages to keep.

MovePages(IEnumerable<Int32>, Int32, DocumentEditor.IndexPosition)

Move the referenced pages to a new location.

Declaration
public void MovePages(IEnumerable<int> pagesToMove, int moveToIndex, DocumentEditor.IndexPosition indexPosition)
Parameters
Type Name Description
IEnumerable<System.Int32> pagesToMove

The pages to move.

System.Int32 moveToIndex

The index to move to.

DocumentEditor.IndexPosition indexPosition

Move the pages before or after the given index.

RemovePages(IEnumerable<Int32>)

Remove the referenced pages.

Declaration
public void RemovePages(IEnumerable<int> pageIndices)
Parameters
Type Name Description
IEnumerable<System.Int32> pageIndices

All the pages to remove.

RotatePages(IEnumerable<Int32>, Rotation)

Rotate the reference pages by the rotation given.

Declaration
public void RotatePages(IEnumerable<int> pagesToRotate, Rotation rotation)
Parameters
Type Name Description
IEnumerable<System.Int32> pagesToRotate

The pages to rotate.

Rotation rotation

The rotation to apply in 90 degree increments.

SaveDocument(IWritableDataProvider)

Apply the staged operations and export.

Declaration
public void SaveDocument(IWritableDataProvider writableDataProvider)
Parameters
Type Name Description
IWritableDataProvider writableDataProvider

The data provider to export the document to.

SetPageLabel(IEnumerable<Int32>, String)

Set a label on the given pages.

Declaration
public void SetPageLabel(IEnumerable<int> pageIndices, string label)
Parameters
Type Name Description
IEnumerable<System.Int32> pageIndices

The pages to set the label.

System.String label

The label to set.