GroupDocs.Viewer for .NET 17.5.0 Release Notes

Major Features

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

  • Added setting which allows showing comments when rendering Words (Text documents) and Cells (Spreadsheet documents)
  • JpegQuality setting allows adjusting quality and size when rendering as PDF
  • HtmlResourcePrefix setting accepts empty string to avoid setting default prefix for HTML resources (styles, fonts, and images)

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
WEB-2143Get print URl for document in JavaScript APINew Feature
VIEWERNET-1192Show comments when rendering Cells documentsNew Feature
VIEWERNET-1184Show comments when rendering Words documentsNew Feature
VIEWERNET-1194Create lower-case name when rendering document from streamImprovement
VIEWERNET-1190Throw GroupDocsViewerException when file type can’t be determined for passed streamImprovement
VIEWERNET-1170Extend support for setting JpegQuality when rendering documents as pdfImprovement
VIEWERNET-1164Improve look of comments in API reference documentationImprovement
VIEWERNET-1163Do not set resource prefix when HtmlResourcePrefix is empty stringImprovement
VIEWERNET-1080Add code examples to EmailOptions class documentation commentsImprovement
VIEWERNET-1079Add code examples to DiagramOptions class documentation commentsImprovement
VIEWERNET-1076Remove obsolete CountPagesToConvert and PageNumbersToConvert RenderOptions propertiesImprovement
WEB-1895Text selection flickers in converted HTMLBug
VIEWERNET-1204Viewer creates temp folder when caching is disabledBug
VIEWERNET-1183Comments in Word document are not rendered in output HTML/imageBug
VIEWERNET-1181File data file updated on each GetDocumentInfo callBug
VIEWERNET-1158Content of Excel document is jumbled up when rendering into HTMLBug
VIEWERNET-1141Inline styles are used when styles are set to be saved separatelyBug
VIEWERNET-1026API is rendering PDF document into blank HTML pagesBug
VIEWERNET-987Incomplete image when converting specific dwgBug
VIEWERNET-938Save method requires System.Web referenceBug
VIEWERNET-7603D effect of the text in a shape is lost while converting spreadsheet to HTMLBug
VIEWERNET-756Incorrect Font Color in Rendering Excel to HtmlBug

Public API and Backward Incompatible Changes

Show Comments when Rendering Cells and Words Documents

Rendering Microsoft Word document with comments.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
  
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
string guid = "document.docx";
  
// Set words options to render content with comments
HtmlOptions options = new HtmlOptions();
options.RenderComments = true; // Default value is false
 
// Get pages 
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);
}

Get PDF representation of Microsoft Word document with comments.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
  
// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "document.docx";
  
// Set pdf options to get pdf file with comments
PdfFileOptions options = new PdfFileOptions();
options.RenderComments = true; // Default value is false
 
// Get pdf document with comments
FileContainer fileContainer = imageHandler.GetPdfFile(guid, pdfFileOptions);
// Access result pdf document using fileContainer.Stream property

Extend Support for Setting JpegQuality when Rendering Documents as PDF

Set output quality when rendering documents into pdf

When documents are rendered as pdf, sometimes we might be unhappy with a very big size of the resulting pdf, or we might intentionally want to reduce the quality of render result. For this purposes, you can use PdfFileOptions.JpegQuality property as shown in the example below. Valid values for this option are in the range between 1 and 100, where 100 stands for the best quality and biggest size and 1 stands for the lowest quality and lowest size of resulting pdf document. The default value is 90.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage\";
 
// Create image handler
 ViewerImageHandler handler = new ViewerImageHandler(config);
string guid = "document.djvu";
 
// Set pdf options JpegQuality in a range between 1 and 100
PdfFileOptions pdfFileOptions = new PdfFileOptions();
pdfFileOptions.JpegQuality = 5;
 
// Get file as pdf
using (FileContainer container = handler.GetPdfFile(guid, pdfFileOptions))
{
    Console.WriteLine("Stream lenght: {0}", container.Stream.Length);
}
List of formats affected by PdfFileOptions.JpegQuality property when rendered as PDF
Format NameDescription
Microsoft WordAffects JPEG images contained in Microsoft Word documents
Microsoft PowerPointAffects JPEG images contained in Microsoft PowerPoint documents
Microsoft OutlookAffects JPEG images set as a background in email documents msg and eml formats
OpenDocument FormatsAffects JPEG images contained in OpenDocument presentation (odp) andOpenDocument text (odt) formats
Image filesAffects rendering from PSD, TIFF, multi-page TIFF, WebP and DjVu formats
MetafileAffects rendering from WMF and EMF formats
Microsoft VisioAffects JPEG images contained inside Microsoft Visio documents

Throw GroupDocsViewerException when File Type can’t be Determined for Passed Stream

GroupDocs.Viewer will throw GroupDocsViewerException instead of EndOfStreamException when GroupDocs.Viewer can’t determine file type.

Create Lowercase Name when Rendering Document from Stream

GroupDocs.Viewer will create the lower-case name for the document. Name consists of 32 digits separated by hyphens: 00000000-0000-0000-0000-000000000000 (GUID) and extension e.g. 00000000-0000-0000-0000-000000000000.docx.

List of changes in GroupDocs.Viewer for .NET 17.5.0

GroupDocs.Viewer.Converter.Options.FileDataOptions

Public bool UseCache property added

This property indicates whether the cache is used while obtaining file data.

GroupDocs.Viewer.Converter.Options.RenderOptions

Public int CountPagesToConvert property obsolete property has been removed

Please use CountPagesToRender property instead.

Public List PageNumbersToConvert property obsolete property has been removed

Please use PageNumbersToRender property instead.

GroupDocs.Viewer.Domain.Containers.FileTreeContainer

Public GroupDocs.Viewer.Domain.Containers.FileTreeContainer obsolete class and class public members have been removed

Please use FileListContainer class instead.

GroupDocs.Viewer.Domain.Containers.RotatePageContainer

Public GroupDocs.Viewer.Domain.Containers.RotatePageContainer obsolete class and class public members removed

To get rotation angles use GetDocumentInfo method after calling RotatePage.

GroupDocs.Viewer.Domain.ContentControl

Public GroupDocs.Viewer.Domain.ContentControl obsolete class and class public members removed

This class has been completely deleted. There no alternative provided for this class.

GroupDocs.Viewer.Domain.EmailAttachment

Public GroupDocs.Viewer.Domain.EmailAttachment class and class members are set as obsolete

Please use GroupDocs.Viewer.Domain.Attachment class instead. This class is obsolete and will be removed in version 17.8.0.

GroupDocs.Viewer.Domain.EmailFileData

Public GroupDocs.Viewer.Domain.EmailFileData class and class members are set as obsolete

Please use FileData class instead. This class is obsolete and will be removed in version 17.8.0.

GroupDocs.Viewer.Domain.Options.FileTreeOptions

Public GroupDocs.Viewer.Domain.Options.FileTreeOptions obsolete class and class public members have been removed

Please use FileListOptions class instead.

GroupDocs.Viewer.Domain.Options.PrintableHtmlOptions

Public string Guid obsolete property removed

Please use GetPrintableHtml method of corresponding ViewerHandler class with guid parameter.

Constructors with guid parameter removed:
public PrintableHtmlOptions(string guid, string css, Watermark watermark)
public PrintableHtmlOptions(string guid, Watermark watermark)
public PrintableHtmlOptions(string guid, string css)
public PrintableHtmlOptions(string guid)

All constructors with guid parameter removed, use paramterless constructor instead and pass guid to GetPrintableHtml method of corresponding ViewerHandler.

GroupDocs.Viewer.Domain.Options.ReorderPageOptions

Public string Guid obsolete property removed

Please, pass guid parameter to ReorderPage method of corresponding ViewerHandler instead.

Obsolete constructors with guid parameter removed
public ReorderPageOptions(string guid, int pageNumber, int newPosition, string password)
public ReorderPageOptions(string guid, int pageNumber, int newPosition)

Two obsolete constructors with guid parameter removed, use the overloaded constructor without guid instead and pass guid parameter to ReorderPage method of corresponding ViewerHandler.

GroupDocs.Viewer.Domain.Options.RotatePageOptions

Public string Guid obsolete property removed

Please, pass guid parameter to RotatePage method of corresponding ViewerHandler instead.

Obsolete constructors with guid parameter removed:
public RotatePageOptions(string guid, int pageNumber, int rotationAngle, string password)
public RotatePageOptions(string guid, int pageNumber, int rotationAngle)

Two obsolete constructors with guid parameter removed, use overloaded constructor without guid instead and pass guid parameter to RotatePage method of corresponding ViewerHandler.

GroupDocs.Viewer.Domain.WordsFileData

Public GroupDocs.Viewer.Domain.WordsFileData obsolete class and class public members removed

This class has been completely removed. There is no substitution provided for this class.

GroupDocs.Viewer.Handler.Input.IInputDataHandler

Obsolete void SaveDocument(CachedDocumentDescription cachedDocumentDescription, Stream documentStream) method removed

Please implement AddFile(string guid, Stream content) method instead.

Obsolete List LoadFileTree(FileTreeOptions fileTreeOptions) method removed

Please implement GetEntities(string path) method instead.

GroupDocs.Viewer.Handler.ViewerHandler

Public FileTreeContainer LoadFileTree () method is removed

Please use GetFileList() method instead.

Public FileTreeContainer LoadFileTree(FileTreeOptions fileTreeOptions) method is removed

Please use GetFileList(FileListOptions fileListOptions) method instead.

Public PrintableHtmlContainer GetPrintableHtml(PrintableHtmlOptions printableHtmlOptions) obsolete method removed

Please use GetPrintableHtml method of the ViewerHtmlHandler class with guid parameter.

Public RotatePageContainer RotatePage(RotatePageOptions rotatePageOptions) obsolete method removed

Please use RotatePage method with guid parameter instead.

Public void ReorderPage(ReorderPageOptions reorderPageOptions) obsolete method removed

Please use ReorderPage method with guid parameter instead

GroupDocs.Viewer.Handler.ViewerHtmlHandler

Public PrintableHtmlContainer GetPrintableHtml(PrintableHtmlOptions printableHtmlOptions) removed

Please use GetPrintableHtml method of the ViewerHtmlHandler class with guid parameter.

GroupDocs.Viewer.Handler.ViewerImageHandler

Public PrintableHtmlContainer GetPrintableHtml(PrintableHtmlOptions printableHtmlOptions) method removed

Please use GetPrintableHtml method of the ViewerImageHandler class with guid parameter.

GroupDocs.Viewer.Helper.FileDataJsonSerializer

Public GroupDocs.Viewer.Helper.FileDataJsonSerializer obsolete class and class public members removed

This class has been completely removed. There is no alternative provided for this class.