Click or drag to resize

PdfStorageAdapterRemoveOldDocuments Method (TimeSpan, Boolean)

Remove documents older than a given period of time.

Namespace:  RadPdf.Integration
Assembly:  RadPdf (in RadPdf.dll) Version: 3.48.0.0 (3.48.0.0)
Syntax
public void RemoveOldDocuments(
	TimeSpan olderThan,
	bool onlyKeyless
)

Parameters

olderThan
Type: SystemTimeSpan
Resources older than this value will be removed from storage.
onlyKeyless
Type: SystemBoolean
If true, only documents without a valid DocumentKey will be removed.
Remarks

This method is typically used to perform maintenance on the storage provider used by RAD PDF.

This operation may require a substantial amount of time to complete.

olderThan should be a positive TimeSpan value.

This operation defaults to using the document's creation date.

Examples
In this example, we run a portion of the RAD PDF maintenance routinue. If using RAD PDF's storage as temporary cache, a value of about 7 days is typical.
C#
// Create a new instance of the PdfStorageAdapter using settings from web.config
using(PdfStorageAdapter adapter = new PdfStorageAdapter())
{
    adapter.RemoveOldDocuments(new TimeSpan(7, 0, 0, 0), true);
}
See Also