GroupDocs.Viewer for .NET 18.11 Release Notes

Major Features

There are 13 features, improvements, and fixes in this regular monthly release. The most notable are:

  • Added following file formats support * Printer Command Language(PCL)
    * Tab-separated values (TSV)
  • Handling fonts while rendering MS OneNote documents
  • A new method for rendering attachments while working with source document’s stream

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-128Add PCL file format supportFeature
VIEWERNET-1786Add TSV (Tab-separated values) file format supportFeature
VIEWERNET-1768Rendering comments from ODP presentation documents that has no authorImprovement
VIEWERNET-1778Rendering attachments while working with source document’s streamImprovement
VIEWERNET-1787Extend support for ExcludeFonts setting of HtmlOptions class for MS OneNote documentsImprovement
VIEWERNET-1789Exporting font files as external resources when rendering MS OneNote documentsImprovement
VIEWERNET-1793Add support for DefaultFontName option when rendering MS OneNote documentsImprovement
VIEWERNET-1549Exception when rendering email message containing .msg file as attachmentBug
VIEWERNET-133Issues when rendering Japanese PDF document to HTMLBug
VIEWERNET-1231Font lightness is ignored for rendering Presentations into HTMLBug
VIEWERNET-1790Resources are not created in cache after GetPrintableHtml calledBug
VIEWERNET-1801Unexpected behavior of cache when both Image and Html handlers instantiatedBug
VIEWERNET-1803Missing pst and ost formats in GetSupportedDocumentFormats();Bug

Public API and Backward Incompatible Changes

Supported File Formats

Following are the file formats that are supported since v18.11.

  • Printer Command Language(PCL)
  • Tab-separated values (TSV)

List of Changes in v18.11

In version 18.11, following public class members were added, marked as obsolete, removed or replaced.

GroupDocs.Viewer.Domain.Containers.DocumentInfoContainer

string DocumentType { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

string FileType { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

string DocumentTypeFormat { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

GroupDocs.Viewer.Domain.FileDescription

string BaseName { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. To get base name use following code: System.IO.Path.GetFileNameWithoutExtension(fileDescription.Name).

string DocumentType { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

string FileType { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

string DocumentTypeFormat { get; } property compilation is set to fail

This property is obsolete and will be removed after v18.11. Use FileFormat property instead.

GroupDocs.Viewer.Handler.Input.IInputDataHandler

DateTime GetLastModificationDate(string guid) method has been removed

GroupDocs.Viewer will rely on LastModificationDate field in FileDescription object returned by GetFileDescription method.

GroupDocs.Viewer.Handler.ViewerHtmlHandler

public FileContainer GetFile(Stream fileStream, AttachmentBase attachment) overload has been added

Use this overload ofGetFilemethod to obtain attachment from document stream as shown in the following example.

Obtaining attachment original file using document stream (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
 
// Create HTML handler object
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
 
// Create attachment object and print out its name and file type
Attachment attachment = new Attachment("document-with-attachments.msg", "attachment-image.png");
Console.WriteLine("Attach name: {0}, size: {1}", attachment.Name, attachment.FileType);
 
// Get attachment original file using document stream
using (FileStream fileStream = new FileStream("document-with-attachments.msg", FileMode.Open))
using (FileContainer fileContainer = htmlHandler.GetFile(fileStream, attachment))
{
    Console.WriteLine("Attach stream lenght: {0}", fileContainer.Stream.Length);
}
public List GetPages(Stream fileStream, AttachmentBase attachment) overload has been added

Use this overload of GetPages method to render attachment from document stream as shown below.

public List GetPages(Stream fileStream, AttachmentBase attachment, HtmlOptions htmlOptions) overload has been added

Use this overload of GetPages method to render attachment from document stream as shown below.

Rendering attachment using document stream (C#)

// Setup GroupDocs.Viewer config
ViewerConfig viewerConfig = new ViewerConfig();
viewerConfig.StoragePath = "c:\\storage";
viewerConfig.UseCache = true;
 
using (FileStream fileStream = new FileStream("document-with-attachments.msg", FileMode.Open))
{
    // Init viewer HTML handler
    ViewerHtmlHandler handler = new ViewerHtmlHandler(viewerConfig);
 
    DocumentInfoContainer info = handler.GetDocumentInfo(fileStream);
 
    // Iterate over the attachments collection
    foreach (AttachmentBase attachment in info.Attachments)
    {
        Console.WriteLine("Attach name: {0}, size: {1}", attachment.Name, attachment.FileType);
 
        // Get attachment document image representation
        List<PageHtml> pages = handler.GetPages(fileStream, attachment, htmlOptions);
        foreach (PageImage page in pages)
            Console.WriteLine("  Page: {0}, size: {1}", page.PageNumber, page.Stream.Length);
    }
}

GroupDocs.Viewer.Handler.ViewerImageHandler

public FileContainer GetFile(Stream fileStream, AttachmentBase attachment) overload has been added

Use this overload ofGetFilemethod to obtain attachment from the document stream as shown in the following example.

Obtaining attachment original file using document stream (C#)

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
 
// Create image handler object
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
 
// Create attachment object and print out its name and file type
Attachment attachment = new Attachment("document-with-attachments.msg", "attachment-image.png");
Console.WriteLine("Attach name: {0}, size: {1}", attachment.Name, attachment.FileType);
 
// Get attachment original file using document stream
using (FileStream fileStream = new FileStream("document-with-attachments.msg", FileMode.Open))
using (FileContainer fileContainer = imageHandler.GetFile(fileStream, attachment))
{
    Console.WriteLine("Attach stream lenght: {0}", fileContainer.Stream.Length);
}
public List GetPages(Stream fileStream, AttachmentBase attachment) overload has been added

Use this overload of GetPages method to render attachment from document stream as shown below.

public List GetPages(Stream fileStream, AttachmentBase attachment, HtmlOptions htmlOptions) overload has been added

Use this overload of GetPages method to render attachment from document stream as shown below.

Rendering attachment using document stream (C#)

// Setup GroupDocs.Viewer config
ViewerConfig viewerConfig = new ViewerConfig();
viewerConfig.StoragePath = "c:\\storage";
viewerConfig.UseCache = true;
 
using (FileStream fileStream = new FileStream("document-with-attachments.msg", FileMode.Open))
{
    // Init viewer image handler
    ViewerImageHandler handler = new ViewerImageHandler(viewerConfig);
 
    DocumentInfoContainer info = handler.GetDocumentInfo(fileStream);
 
    // Iterate over the attachments collection
    foreach (AttachmentBase attachment in info.Attachments)
    {
        Console.WriteLine("Attach name: {0}, size: {1}", attachment.Name, attachment.FileType);
 
        // Get attachment document image representation
        List<PageImage> pages = handler.GetPages(fileStream, attachment, htmlOptions);
        foreach (PageImage page in pages)
            Console.WriteLine("  Page: {0}, size: {1}", page.PageNumber, page.Stream.Length);
    }
}