Class DocumentSource
Represents the source of a document, which may be a Windows.Storage.StorageFile, an Windows.Storage.Streams.IBuffer, or a IDataProvider.
Inheritance
Namespace: PSPDFKit.Document
Assembly: PSPDFKit.dll
Syntax
public sealed class DocumentSource
Properties
Password
The 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 document. |
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. |
CreateFromStorageFileUidAsync(String)
Create a DocumentSource from a PSPDFKit StorageFile 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> CreateFromStorageFileUidAsync(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. |
CreateFromUidAsync(String)
Create a DocumentSource from a PSPDFKit StorageFile UID.
Can throw a System.IO.DirectoryNotFoundException or System.IO.FileNotFoundException if
the UID is not in the correct format.
Declaration
[Obsolete("Please use CreateFromStorageFileUidAsync() instead.")]
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. |
Finalize()
Declaration
protected void Finalize()
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. |