WatermarkerGeneratePreview Method
Generates preview images for the document.

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

Parameters

previewOptions
Type: GroupDocs.Watermark.OptionsPreviewOptions
Additional options to use when generating preview images.
Examples
Generate preview image for the first page of Word document.
C#
CreatePageStream createPageStreamDelegate = delegate(int number)
                                            {
                                                string previewImageFileName = string.Format("page{0}.png", number);
                                                return File.OpenWrite(previewImageFileName);
                                            };
ReleasePageStream releasePageStreamDelegate = delegate(int number, Stream stream)
                                              {
                                                  stream.Close();
                                              };
PreviewOptions previewOptions = new PreviewOptions(createPageStreamDelegate, releasePageStreamDelegate)
                                {
                                    PreviewFormat = PreviewOptions.PreviewFormats.PNG,
                                    PageNumbers = new []{1}
                                };

using (Watermarker watermarker = new Watermarker(@"C:\Documents\test.docx"))
{
    watermarker.GeneratePreview(previewOptions);
}
See Also