usmanazizgroupdocs
8/25/2016 - 8:20 AM

RenderExcelAsHtmlWithInternalHyperlinkPrefix.cs

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

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

// Set html options to show grid lines
HtmlOptions options = new HtmlOptions();
options.CellsOptions.InternalHyperlinkPrefix = "http://contoso.com/api/getPage?name=";

//InternalHyperlinkPrefix value may contain page number placeholder which will be substituted with referenced sheet number.
options.CellsOptions.InternalHyperlinkPrefix = "http://contoso.com/api/getPage?number={page-number}";

DocumentInfoContainer container = htmlHandler.GetDocumentInfo(guid);

List<PageHtml> pages = htmlHandler.GetPages(guid, options);

foreach (PageHtml page in pages)
{
    //Save each page at disk
    Utilities.SaveAsHtml(page.PageNumber + "_" + DocumentName, page.HtmlContent);
}