CreatePageStream Delegate
Represents method that returns a stream to write page preview data.

Namespace: GroupDocs.Redaction.Options
Assembly: GroupDocs.Redaction (in GroupDocs.Redaction.dll) Version: 20.7
Syntax
public delegate Stream CreatePageStream(
	int pageNumber
)

Parameters

pageNumber
Type: SystemInt32
Page number of a page to generate thumbnail

Return Value

Type: Stream
Stream to write page preview
Examples

The following example demonstrates how get a document preview using PreviewOptions and CreatePageStream delegate.

C#
CreatePageStream createDelegate = delegate (int pageNumber)
{
    var pagePath = System.IO.Path.Combine(@"C:\Temp", string.Format("page_{0}.png", pageNumber));
    return System.IO.File.Create(pagePath);
};
var previewOptions = new PreviewOptions(createDelegate);
previewOptions.PreviewFormat = PreviewOptions.PreviewFormats.PNG;
previewOptions.Height = 640;
previewOptions.Width = 480;
previewOptions.PageNumbers = new int[] { 1 };
using (var redactor = new Redactor("C:\Temp\SourceFile.pdf"))
{
    redactor.GeneratePreview(previewOptions);
}
See Also