Class DocumentManager
DocumentManager is there to aid in creating temporary files for opening documents, and to make sure that these temporary documents work with the recent list.
In short, the DocumentManager will generate temporary files and keeps a mapping of standard file paths to temporary file paths.
Inheritance
System.Object
DocumentManager
Assembly: pdftron.PDF.Tools.dll
public class DocumentManager : object
Fields
Declaration
public const string TabPreviewFolderName = null
Field Value
| Type |
Description |
| System.String |
|
Properties
Declaration
public static DocumentManager Instance { get; }
Property Value
Flag to indicate when DocumentManager has been initialized
Declaration
public static bool IsReady { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Methods
Declaration
public Task AddChangesToOriginalAsync(StorageFile original, StorageFile temporaryFile, bool isDropBox = false)
Parameters
| Type |
Name |
Description |
| Windows.Storage.StorageFile |
original |
|
| Windows.Storage.StorageFile |
temporaryFile |
|
| System.Boolean |
isDropBox |
|
Returns
Delete all temporary sound annotation files created during recording
Declaration
public static Task CleanupTempAudioFilesFromDiskAsync()
Returns
Call this when a StorageFile is no longer needed.
Declaration
public void CloseFile(StorageFile file)
Parameters
| Type |
Name |
Description |
| Windows.Storage.StorageFile |
file |
|
Gets the path at which the document would have been stored in the recently used cache.
Declaration
public string GetRecentThumbnailPath(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
Returns
| Type |
Description |
| System.String |
|
Declaration
public Task<string> GetRecentThumbnailPathAsync(string fileName)
Parameters
| Type |
Name |
Description |
| System.String |
fileName |
|
Returns
| Type |
Description |
| Task<System.String> |
|
Declaration
public Task InitializeInstanceAsync()
Returns
Copies the file to the temporary folder and returns the new file
The same file will always come back with the same path, provided it is in the recent list.
Declaration
public Task<StorageFile> OpenTemporaryCopyAsync(StorageFile file, bool generateNew = false)
Parameters
| Type |
Name |
Description |
| Windows.Storage.StorageFile |
file |
The StorageFile to create a temp copy for
|
| System.Boolean |
generateNew |
Whether we should always create a new temp file, even if it's already in the list.
|
Returns
| Type |
Description |
| Task<Windows.Storage.StorageFile> |
|
This call will perform a full cleanup of temporary files created on runtime
Declaration
public Task PerformFullCleanupAsync()
Returns
Saves the audio stream to disk using a WAVE format
Declaration
public static Task<StorageFile> SaveAudioStreamToDiskAsync(IRandomAccessStream stream)
Parameters
| Type |
Name |
Description |
| Windows.Storage.Streams.IRandomAccessStream |
stream |
|
Returns
| Type |
Description |
| Task<Windows.Storage.StorageFile> |
|
Saves the raw audio bytes in wave format to disk
Declaration
public static Task<StorageFile> SaveAudioWaveToDiskAsync(byte[] bytes)
Parameters
| Type |
Name |
Description |
| System.Byte[] |
bytes |
|
Returns
| Type |
Description |
| Task<Windows.Storage.StorageFile> |
|
Save a PDFDoc to disk as a StorageFile
Declaration
public Task<StorageFile> SaveToTemporaryFileAsync(PDFDoc doc, string newName, bool cleanTempfolder = true)
Parameters
| Type |
Name |
Description |
| PDFDoc |
doc |
The PDFDoc to be saved
|
| System.String |
newName |
File name
|
| System.Boolean |
cleanTempfolder |
|
Returns
| Type |
Description |
| Task<Windows.Storage.StorageFile> |
|
Start timer to execute the cleanup of temporary files
Declaration
public Task StartAutoCleanAsync()
Returns
Stop timer to execute the cleanup of temporary files
Declaration
public Task StopAutoCleanAsync()
Returns