usmanazizgroupdocs
3/24/2017 - 11:06 AM

RenderPDFDocumentWithoutAnnotations.cs

// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
//Get Configurations 
ViewerConfig config = Utilities.GetConfigurations();

// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);

// Set pdf options to render content without annotations
HtmlOptions options = new HtmlOptions();
options.RenderComments = false; // Default value is false
//options.RenderComments = true; // For rendering document with annotations

// Call GetPdfFile to get FileContainer type object which contains the stream of pdf file.
FileContainer container = imageHandler.GetPdfFile(DocumentName);

//Change the extension of the file and assign to a string type variable filename
String filename = Path.GetFileNameWithoutExtension(DocumentName) + ".pdf";

//Save each image at disk
Utilities.SaveFile(filename, container.Stream);