Class DocumentSource

Represents the source of a document, which may be a Windows.Storage.StorageFile or an Windows.Storage.Streams.IBuffer

Inheritance
System.Object
DocumentSource
Namespace: PSPDFKit.Document
Assembly: PSPDFKit.dll
Syntax
public sealed class DocumentSource : object

Properties

Password

The PDF password if required.

Declaration
public string Password { get; set; }
Property Value
Type Description
System.String

Methods

CreateFromBuffer(IBuffer)

Create a DocumentSource from an Windows.Storage.Streams.IBuffer

Declaration
public static DocumentSource CreateFromBuffer(IBuffer buffer)
Parameters
Type Name Description
Windows.Storage.Streams.IBuffer buffer

The buffer this DocumentSource represents.

Returns
Type Description
DocumentSource

A DocumentSource representing the buffer.

CreateFromDataProvider(IDataProvider)

Create a DocumentSource from a PSPDFKit.Document.DocumentSource.DataProvider.

Declaration
public static DocumentSource CreateFromDataProvider(IDataProvider dataProvider)
Parameters
Type Name Description
IDataProvider dataProvider

The IDataProvider that is the data source of the PDF.

Returns
Type Description
DocumentSource

CreateFromStorageFile(StorageFile)

Create a DocumentSource from a Windows.Storage.StorageFile

Declaration
public static DocumentSource CreateFromStorageFile(StorageFile file)
Parameters
Type Name Description
Windows.Storage.StorageFile file

The storage file this DocumentSource represents.

Returns
Type Description
DocumentSource

A DocumentSource representing the storage file.

CreateFromUidAsync(String)

Create a DocumentSource from a PSPDFKit UID Can throw a or if the UID is not in the correct format.

Declaration
public static IAsyncOperation<DocumentSource> CreateFromUidAsync(string uid)
Parameters
Type Name Description
System.String uid

The UID this DocumentSource represents.

Returns
Type Description
Windows.Foundation.IAsyncOperation<DocumentSource>

A DocumentSource representing the file.

GetBuffer()

Gets the Windows.Storage.Streams.IBuffer representing the DocumentSource if it was created with one.

Declaration
public IBuffer GetBuffer()
Returns
Type Description
Windows.Storage.Streams.IBuffer

The originating Windows.Storage.Streams.IBuffer or null.

GetDataProvider()

Gets the IDataProvider representing the DocumentSource if it was created with one.

Declaration
public IDataProvider GetDataProvider()
Returns
Type Description
IDataProvider

The originating IDataProvider or null.

GetFile()

Gets the Windows.Storage.StorageFile representing the DocumentSource if it was created with one.

Declaration
public StorageFile GetFile()
Returns
Type Description
Windows.Storage.StorageFile

The originating Windows.Storage.StorageFile or null.

See Also