Interface IController
Interface that represents the PSPDFKit viewer to view documents.
Namespace: PSPDFKit.Api
Assembly: Api.dll
Syntax
public interface IController
Properties
| Edit this page View SourceAnnotationToolbar
Gets annotation toolbar instance.
Declaration
IAnnotationToolbar AnnotationToolbar { get; }
Property Value
Type | Description |
---|---|
IAnnotationToolbar |
MainToolbar
Gets main toolbar instance.
Declaration
IMainToolbar MainToolbar { get; }
Property Value
Type | Description |
---|---|
IMainToolbar |
Methods
| Edit this page View SourceCreateViewerConfiguration()
Creates a default configuration object for PSPDFKit Viewer or retrieves the current configuration.
Declaration
IViewerConfiguration CreateViewerConfiguration()
Returns
Type | Description |
---|---|
IViewerConfiguration | Default IViewerConfiguration object. |
ExecuteJavaScriptFunctionAsync(string, object[])
Execute a function from PSPDFKit for Web's JavaScript API that doesn't return anything.
Declaration
Task ExecuteJavaScriptFunctionAsync(string functionName, object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | functionName | Name of JavaScript function to be called. |
object[] | args | Arguments to be passed to the function. |
Returns
Type | Description |
---|---|
Task | A task that represents an asynchronous operation of calling a JavaScript function. |
Remarks
To access any member of the current document instance, use
PSPDFKit.MAUI.MauiBridge.currentInstance.memberName
.
ExecuteJavaScriptFunctionAsync<TReturnType>(string, object[])
Execute a function from PSPDFKit for Web's JavaScript API that returns a value.
Declaration
Task<TReturnType> ExecuteJavaScriptFunctionAsync<TReturnType>(string functionName, object[] args)
Parameters
Type | Name | Description |
---|---|---|
string | functionName | Name of JavaScript function to be called. |
object[] | args | Arguments to be passed to the function. |
Returns
Type | Description |
---|---|
Task<TReturnType> | A task that represents an asynchronous operation of calling a JavaScript function. |
Type Parameters
Name | Description |
---|---|
TReturnType | Type of return value. |
Remarks
To access any member of the current document instance, use
PSPDFKit.MAUI.MauiBridge.currentInstance.memberName
.
LoadDocumentAsync(string, IViewerConfiguration)
Loads a document located at a specified path in the PSPDFKit viewer with sent viewer configuration.
Declaration
Task<IDocument> LoadDocumentAsync(string fullPath, IViewerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
string | fullPath | Full path where a document is located. |
IViewerConfiguration | configuration | Configuration with which the viewer should be loaded. |
Returns
Type | Description |
---|---|
Task<IDocument> | A task that represents an asynchronous operation of loading a document in the PSPDFKit SDK using its path. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Received incorrect type of configuration. Please use the CreateViewerConfiguration() method to create a valid viewer configuration. |
LoadDocumentFromAssetsAsync(string, IViewerConfiguration)
Loads a document located at a specified asset path in the PSPDFKit viewer with sent viewer configuration.
Declaration
Task<IDocument> LoadDocumentFromAssetsAsync(string assetDocumentPath, IViewerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
string | assetDocumentPath | Path of a document located in the |
IViewerConfiguration | configuration | Configuration with which the viewer should be loaded. |
Returns
Type | Description |
---|---|
Task<IDocument> | A task that represents an asynchronous operation of loading an asset document in the PSPDFKit SDK using its path. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Received incorrect type of configuration. Please use the CreateViewerConfiguration() method to create a valid viewer configuration. |
LoadDocumentFromBase64StringAsync(string, IViewerConfiguration)
Loads a document in the PSPDFKit viewer using its contents as a Base64 string with sent viewer configuration.
Declaration
Task<IDocument> LoadDocumentFromBase64StringAsync(string documentAsBase64String, IViewerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
string | documentAsBase64String | Content of document as a Base64 string. |
IViewerConfiguration | configuration | Configuration with which the viewer should be loaded. |
Returns
Type | Description |
---|---|
Task<IDocument> | A task that represents an asynchronous operation of loading a document in the PSPDFKit SDK using its contents as Base64 string. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Received incorrect type of configuration. Please use the CreateViewerConfiguration() method to create a valid viewer configuration. |
LoadDocumentFromBufferAsync(byte[], IViewerConfiguration)
Loads a document in the PSPDFKit viewer using its contents as a byte array with the sent viewer configuration.
Declaration
Task<IDocument> LoadDocumentFromBufferAsync(byte[] buffer, IViewerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | Content of a document as a buffer. |
IViewerConfiguration | configuration | Configuration with which the viewer should be loaded. |
Returns
Type | Description |
---|---|
Task<IDocument> | A task that represents an asynchronous operation of loading a document in PSPDFKit SDK using its contents as a buffer. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Received incorrect type of configuration. Please use the CreateViewerConfiguration() method to create a valid viewer configuration. |
LoadDocumentFromURLAsync(string, IViewerConfiguration)
Loads a document in the PSPDFKit viewer located at a remote location with sent viewer configuration.
Declaration
Task<IDocument> LoadDocumentFromURLAsync(string url, IViewerConfiguration configuration)
Parameters
Type | Name | Description |
---|---|---|
string | url | Location of document. |
IViewerConfiguration | configuration | Configuration with which the viewer should be loaded. |
Returns
Type | Description |
---|---|
Task<IDocument> | A task that represents an asynchronous operation of loading a document in the PSPDFKit SDK from a remote location. |
Exceptions
Type | Condition |
---|---|
ArgumentException | Received incorrect type of configuration. Please use the CreateViewerConfiguration() method to create a valid viewer configuration. |