MetadataGeneratePreview Method
Creates preview images for specified pages.

Namespace: GroupDocs.Metadata
Assembly: GroupDocs.Metadata (in GroupDocs.Metadata.dll) Version: 20.10
Syntax
public void GeneratePreview(
	PreviewOptions previewOptions
)

Parameters

previewOptions
Type: GroupDocs.Metadata.OptionsPreviewOptions
A set of options for preview generation.
Remarks
Examples
This code snippet demonstrates how to create image previews for document pages.
C#
using (Metadata metadata = new Metadata(Constants.InputDocx))
{
    PreviewOptions previewOptions = new PreviewOptions(pageNumber => File.Create($"{Constants.OutputPath}\\result_{pageNumber}.png"));
    previewOptions.PreviewFormat = PreviewOptions.PreviewFormats.PNG;
    previewOptions.PageNumbers = new int[] { 1 };

    metadata.GeneratePreview(previewOptions);
}
See Also