Class Document
Inheritance
Namespace: PSPDFKit
Assembly: PSPDFKit.dll
Syntax
public class Document : object
Constructors
Document(IDataProvider)
Open a document.
Declaration
public Document(IDataProvider dataProvider)
Parameters
Type | Name | Description |
---|---|---|
IDataProvider | dataProvider | A IDataProvider holding the document data. |
Methods
CreateDocumentEditor()
Produce a document editor using the current document as a base.
Declaration
public DocumentEditor CreateDocumentEditor()
Returns
Type | Description |
---|---|
DocumentEditor | An instance of the DocumentEditor. |
ExportDocumentJson(IWritableDataProvider)
Exports the changes of a document to Instant Document Json. For the json format please see https://pspdfkit.com/guides/web/current/importing-exporting/instant-json/
Declaration
public void ExportDocumentJson(IWritableDataProvider writableDataProvider)
Parameters
Type | Name | Description |
---|---|---|
IWritableDataProvider | writableDataProvider | The Json will be written to this data provider. |
ExportXfdf(IWritableDataProvider, IEnumerable<Int32>, IEnumerable<String>)
Export XFDF of the current document. For the XFDF specification see https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en
Declaration
public void ExportXfdf(IWritableDataProvider writableDataProvider, IEnumerable<int> annotationsToExport, IEnumerable<string> formFieldsToExport)
Parameters
Type | Name | Description |
---|---|---|
IWritableDataProvider | writableDataProvider | The XFDF will be written to this data provider. |
IEnumerable<System.Int32> | annotationsToExport | The id's of the annotations to export. If empty all annotations will be exported. |
IEnumerable<System.String> | formFieldsToExport | The form fields that should be exported into the XFDF. If empty, all forms will be exported. |
GetAnnotationProvider()
Returns AnnotationProvider object which handles annotations contained in this document.
Declaration
public AnnotationProvider GetAnnotationProvider()
Returns
Type | Description |
---|---|
AnnotationProvider | The annotation provider. |
GetFormProvider()
Returns FormProvider object which handles forms contained in this document.
Declaration
public FormProvider GetFormProvider()
Returns
Type | Description |
---|---|
FormProvider |
GetPage(UInt32)
Retrieve a Page from the document.
Declaration
public Page GetPage(uint pageIndex)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | pageIndex | The index of the page indexed from 0. |
Returns
Type | Description |
---|---|
Page | A Page representing a page in the document. |
GetPageCount()
Retrieve the number of pages in the document.
Declaration
public uint GetPageCount()
Returns
Type | Description |
---|---|
System.UInt32 | Number of Pages |
GetProjection()
Returns auxiliary projection class for mapping coordinate space between raw and normalized Pdf.
Declaration
public Projection GetProjection()
Returns
Type | Description |
---|---|
Projection |
ImportDocumentJson(IDataProvider)
Takes Instant Document Json and imports the changes into the currently loaded document. For the json format please see https://pspdfkit.com/guides/web/current/importing-exporting/instant-json/
Declaration
public void ImportDocumentJson(IDataProvider dataProvider)
Parameters
Type | Name | Description |
---|---|---|
IDataProvider | dataProvider | A provider with the data to import. |
ImportXfdf(IDataProvider)
Import XFDF data into the currently open document. For the XFDF specification see https://www.iso.org/obp/ui/#iso:std:iso:19444:-1:ed-1:v1:en
Declaration
public void ImportXfdf(IDataProvider dataProvider)
Parameters
Type | Name | Description |
---|---|---|
IDataProvider | dataProvider | A provider containing the XFDF data. |
Save(DocumentSaveOptions)
Save the current state back to the IDataProvider used to open the document.
Declaration
public void Save(DocumentSaveOptions documentSaveOptions)
Parameters
Type | Name | Description |
---|---|---|
DocumentSaveOptions | documentSaveOptions | Options to customize the save operation. DocumentSaveOptions |
SaveAs(IWritableDataProvider, DocumentSaveOptions)
Performs a full save of the document to a destination IWritableDataProvider. incremental and forceSave will be ignored as a full write is required to save to a new destination.
Declaration
public void SaveAs(IWritableDataProvider writableDataProvider, DocumentSaveOptions documentSaveOptions)
Parameters
Type | Name | Description |
---|---|---|
IWritableDataProvider | writableDataProvider | The provider to write the document to. |
DocumentSaveOptions | documentSaveOptions | Options to customize the save operation. DocumentSaveOptions |