GroupDocs.Viewer For .NET 3.6.0 Release Notes

Major Features

There are 7 new features and 14 improvements and fixes in this regular monthly release. The most notable are:

  • Add support for Spanish locale.
  • Add support for Italian locale
  • Hide/Show the hidden pages for Visio files
  • Ability to set default font when rendering Cells and Words documents
  • Ability to set the encoding standard automatically
  • LaTeX file format rendering support

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-394Support for hyperlinks referencing a worksheet in the same documentNew Feature
VIEWERNET-433Add support for Spanish localeNew Feature
VIEWERNET-435Add support for Italian localeNew Feature
VIEWERNET-639Hide/Show the hidden pages for Visio filesNew Feature
VIEWERNET-801Ability to set default font when rendering Cells documentsNew Feature
VIEWERNET-802Ability to set default font when rendering Words documentsNew Feature
WEB-2073LaTeX file format rendering supportNew Feature
VIEWERNET-401Improve applying pdf document transformationsImprovement
VIEWERNET-803Ability to set the encoding standard automaticallyImprovement
VIEWERNET-824Cleanup GetDocumentInfo method responseImprovement
VIEWERNET-826Remove XHTML xmlns attributeImprovement
VIEWERNET-827Cleanup html markup for Cells documentsImprovement
VIEWERNET-596The bookmark range is invalid for .docxBug
VIEWERNET-747Text document format detected as UnknownBug
VIEWERNET-805GetPages() Method Throws “Parameter is not valid” ExceptionBug
VIEWERNET-807Output html contains garbled characters and few characters are mergedBug
VIEWERNET-820GetPages() throws exception for email attachmentsBug
VIEWERNET-821API throws exception in MonoBug
VIEWERNET-835User can’t catch GroupDocsExceptionBug
WEB-2070Convert .docx to .pdf wrong symbolBug
WEB-2448Missing character in resultant htmlBug

Public API and Backward Incompatible Changes

Cleanup GetDocumentInfo method response

  • Class GroupDocs.Viewer.Domain.Containers.DocumentInfoContainer field ContentControls marked as ‘obsolete’
  • Class GroupDocs.Viewer.Domain.ContentControl marked as ‘obsolete’
  • Class GroupDocs.Viewer.Domain.WordsFileData field ContentControls marked as ‘obsolete’

User can’t catch GroupDocsException

  • New public class GroupDocs.Viewer.Exception.GroupDocsViewerException
  • All exceptions from GroupDocs.Viewer.Exception namespace are derived classes of GroupDocsViewerException.

How to specify resource prefix

HtmlResourcePrefix setting is necessary when every resource name in html document should be prefixed with some string. This may be useful when resources for document are obtained via some REST API method. Please note that css files will also be processed - html resource prefix value will be added to font names in css file.

HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.HtmlResourcePrefix = "http://contoso.com/api/getResource?name="

If ccs files should not be processed then IgnoreResourcePrefixForCss setting should be set to true.

HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.HtmlResourcePrefix = "http://contoso.com/api/getResource?name="
htmlOptions.IgnoreResourcePrefixForCss = true;

How to set default font name

Default font name may be specified in this cases:
#You want to generally specify the default font to fall back on if particular font in a document cannot be found during rendering.
#Your document uses fonts that non-English characters and you want to make sure any missing font is replaced with one that has the same character set available.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
config.DefaultFontName = "Calibri";

Show hidden pages in MS Visio files

Show hidden pages for Visio files in image representation

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
  
// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "sample.vdx";
  
// Set image options to show hidden pages
ImageOptions options = new ImageOptions();
options.DiagramOptions.ShowHiddenPages = true;
  
DocumentInfoContainer container = imageHandler.GetDocumentInfo(guid);
  
foreach (PageData page in container.Pages)
   Console.WriteLine("Page number: {0}, Page Name: {1}, IsVisible: {2}", page.Number, page.Name, page.IsVisible);
  
List<PageImage> pages = imageHandler.GetPages(guid, options);
  
foreach (PageImage page in pages)
{
   Console.WriteLine("Page number: {0}", page.PageNumber);
  
   // Page image stream
   Stream imageContent = page.Stream;
}

Show hidden pages for Visio files in html representation

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
  
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
string guid = "sample.vdx";
  
// Set html options to show grid lines
HtmlOptions options = new HtmlOptions();
options.DiagramOptions.ShowHiddenPages = true;
  
DocumentInfoContainer container = htmlHandler.GetDocumentInfo(guid);
  
foreach (PageData page in container.Pages)
   Console.WriteLine("Page number: {0}, Page Name: {1}, IsVisible: {2}", page.Number, page.Name, page.IsVisible);
  
List<PageHtml> pages = htmlHandler.GetPages(guid, options);
  
foreach (PageHtml page in pages)
{
   Console.WriteLine("Page number: {0}", page.PageNumber);
   //Console.WriteLine("Html content: {0}", page.HtmlContent);
}

It’s known fact that Excel workbook may contain hyperlink to specific location in the same workbook.

https://support.office.com/en-us/article/Hyperlinks-in-worksheets-EDB15706-517B-4ECF-81C6-84068FF8677E.

InternalHyperlinkPrefix setting is useful for applications where workbook sheets are rendered separately one by one. In this case internal hyperlink may contain some REST API method address with referenced sheet name.

HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.CellsOptions.InternalHyperlinkPrefix = "http://contoso.com/api/getPage?name="

InternalHyperlinkPrefix value may contain page number placeholder which will be substituted with referenced sheet number.

HtmlOptions htmlOptions = new HtmlOptions();
htmlOptions.CellsOptions.InternalHyperlinkPrefix = "http://contoso.com/api/getPage?number={page-number}"