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

Properties

| Improve this Doc View Source

Password

The PDF password if required.

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

Methods

| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

CreateFromUidAsync(String)

Create a DocumentSource from a PSPDFKit UID Can throw a System.IO.DirectoryNotFoundException or System.IO.FileNotFoundException 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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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