In GroupDocs.Redaction, Redactor class supports rendering of the document preview in on of these image formats:
JPEG Image
Portable Network Graphics (PNG)
Bitmap Image File (BMP)
The following example demonstrates how to get a single page preview of the document.
// Take preview of the first pageinttestPageNumber=1;// Preview file namestringpreviewFileName=string.Format("{0}_page{1}.png","D:\\sample.docx",testPageNumber);// Load the document to generate previewusing(Redactorredactor=newRedactor("D:\\sample.docx")){PreviewOptionsoptions=newPreviewOptions(delegate(intpageNumber){returnFile.OpenWrite(previewFileName);});options.Width=480;options.Height=640;options.PageNumbers=newint[]{testPageNumber};options.PreviewFormat=PreviewOptions.PreviewFormats.PNG;redactor.GeneratePreview(options);Console.WriteLine("\nPreview for page {0} was saved to \"{1}\"",testPageNumber,previewFileName);}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.