Show / Hide Table of Contents

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
Namespace: pdftron.PDF.Tools.Utilities
Assembly: pdftron.PDF.Tools.dll
Syntax
public class DocumentManager : object

Fields

TabPreviewFolderName

Declaration
public const string TabPreviewFolderName = null
Field Value
Type Description
System.String

Properties

Instance

Declaration
public static DocumentManager Instance { get; }
Property Value
Type Description
DocumentManager

IsReady

Flag to indicate when DocumentManager has been initialized

Declaration
public static bool IsReady { get; }
Property Value
Type Description
System.Boolean

Methods

AddChangesToOriginalAsync(StorageFile, StorageFile, Boolean)

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
Type Description
Task

CleanupTempAudioFilesFromDiskAsync()

Delete all temporary sound annotation files created during recording

Declaration
public static Task CleanupTempAudioFilesFromDiskAsync()
Returns
Type Description
Task

CloseFile(StorageFile)

Call this when a StorageFile is no longer needed.

Declaration
public void CloseFile(StorageFile file)
Parameters
Type Name Description
Windows.Storage.StorageFile file

GetRecentThumbnailPath(String)

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

GetRecentThumbnailPathAsync(String)

Declaration
public Task<string> GetRecentThumbnailPathAsync(string fileName)
Parameters
Type Name Description
System.String fileName
Returns
Type Description
Task<System.String>

InitializeInstanceAsync()

Declaration
public Task InitializeInstanceAsync()
Returns
Type Description
Task

OpenTemporaryCopyAsync(StorageFile, Boolean)

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>

PerformFullCleanupAsync()

This call will perform a full cleanup of temporary files created on runtime

Declaration
public Task PerformFullCleanupAsync()
Returns
Type Description
Task
Remarks

Calling this on startup might slow down the whole initialization process since accessing disk relies on OS processes

SaveAudioStreamToDiskAsync(IRandomAccessStream)

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>
Remarks

Temp files will be saved to the temporary folder

SaveAudioWaveToDiskAsync(Byte[])

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>
Remarks

Temp files will be saved to the temporary folder

SaveToTemporaryFileAsync(PDFDoc, String, Boolean)

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>

StartAutoCleanAsync()

Start timer to execute the cleanup of temporary files

Declaration
public Task StartAutoCleanAsync()
Returns
Type Description
Task

StopAutoCleanAsync()

Stop timer to execute the cleanup of temporary files

Declaration
public Task StopAutoCleanAsync()
Returns
Type Description
Task
In This Article
Back to top Generated by DocFX