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 Source

AnnotationToolbar

Gets annotation toolbar instance.

Declaration
IAnnotationToolbar AnnotationToolbar { get; }
Property Value
Type Description
IAnnotationToolbar
| Edit this page View Source

MainToolbar

Gets main toolbar instance.

Declaration
IMainToolbar MainToolbar { get; }
Property Value
Type Description
IMainToolbar

Methods

| Edit this page View Source

CreateViewerConfiguration()

Creates a default configuration object for PSPDFKit Viewer or retrieves the current configuration.

Declaration
IViewerConfiguration CreateViewerConfiguration()
Returns
Type Description
IViewerConfiguration

Default IViewerConfiguration object.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 AppPackageBaseDirectory/Assets folder relative to the AppPackageBaseDirectory/Assets folder, i.e. await FileSystem.Current.AppPackageFileExistsAsync(Path.Join("Assets", assetDocumentPath)) should return true. Example: If you want to load AppPackageBaseDirectory/Assets/demo.pdf, the value of assetDocumentPath is equal to demo.pdf.

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.