GroupDocs.Viewer for .NET 19.1 Release Notes

Major Features

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

  • Added VCF file format support
  • Simplified caching interface
  • Obtaining statuses of layers contained in CAD documents
  • Obtaining email messages contained in Outlook Data File documents as attachments

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-1781Add support for VCF formatFeature
VIEWERNET-1782Obtaining email messages contained in OST/PST formats as attachmentsFeature
VIEWERNET-1783Settings for filtering messages from OST/PST documents by subject and contentFeature
VIEWERNET-1784Settings for filtering messages from OST/PST formats by senderFeature
VIEWERNET-1831Obtaining layers statuses for CAD documentsFeature
VIEWERNET-1792Add support for rendering password protected ODS documentsImprovement
VIEWERNET-1812Simplify caching interfaceImprovement
VIEWERNET-1798Descriptive Exception message when non-existing default font name is setImprovement
VIEWERNET-1800Header is missing when rendering Word documentBug
VIEWERNET-1832Exception when getting document info of .msg file using MemoryStreamBug
VIEWERNET-1842Images are not visible in Chrome browser when rendering OneNote documentsBug

Public API and Backward Incompatible Changes

Obtaining and rendering email messages contained in Outlook Data File documents

Since version 19.1, GroupDocs.Viewer for .NET allows getting the list of email messages contained in Outlook Data File documents (OST/PST formats). Email messages are listed as Attachments in DocumentInfoContainer object returned by GetDocumentInfo method of the corresponding viewer handler. They can be obtained through the GetFile method as shown in the example below:

C# (Obtaining attachment from document that is stored on the disk)

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

// Create image handler object and get the list of email messages as attachments.
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
DocumenInfoContainer documentInfo = imageHandler.GetDocumentInfo("archive.pst")
foreach(Attachment attachment in documentInfo.Attachments)
{
    //Print out attachment name and file type.
    Console.WriteLine("Attach name: {0}, size: {1}", attachment.Name, attachment.FileType);

    // Get attachment original file and print out Stream length
    using (FileContainer fileContainer = imageHandler.GetFile(attachment))
    {
        Console.WriteLine("Attach stream lenght: {0}", fileContainer.Stream.Length);
    }
}

Attachments can be rendered as shown in examples below:

// Setup HTML conversion options
HtmlOptions htmlOptions = new HtmlOptions();

// Initialize viewer html handler
ViewerHtmlHandler handler = new ViewerHtmlHandler(viewerConfig);
DocumentInfoContainer info = handler.GetDocumentInfo("archive.pst");

// Iterate over the attachments collection
foreach (AttachmentBase attachment in info.Attachments)
{
    // Get attachment document html representation
    List<PageHtml> pages = handler.GetPages(attachment, htmlOptions);
    foreach (PageHtml page in pages)
    {
        Console.WriteLine("  Page: {0}, size: {1}", page.PageNumber, page.HtmlContent.Length);
    }
}

Filtering Outlook messages when rendering into HTML, image, and PDF

Since version 19.1, GroupDocs.Viewer for .NET allows filtering rendered messages by subject and content or by sender and recipient email address. As an example, when you set OutlookOptions.TextFilter as ‘Susan’ you get rendered all messages that contain text ‘Susan’ in the message subject or body. When you set OutlookOptions.AddressFilter as ‘susan’ you are filtering messages that contain ‘susan’ as a part of the sender or recipient address. The examples below show how to filter the rendered items.

Filtering messages that are rendered into image or HTML

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

// Create image handler or use ViewerHtmlHandler to render into HTML
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "sample.pst";

// Create image options with specified folder name (use HtmlOptions to render into HTML)
ImageOptions options = new ImageOptions();
options.OutlookOptions.TextFilter = "Susan";

// Render document into image (List<PageHtml> is returned when rendering into HTML)
List<PageImage> pages = imageHandler.GetPages(guid, options);

foreach (PageImage page in pages)
{
    // use page.Stream to work with rendering result
}

Filtering messages that are rendered into PDF

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

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "sample.pst";

// Create pdf options with specified address filter
PdfFileOptions options = new PdfFileOptions();
options.OutlookOptions.AddressFilter = "susan";

// Get pdf document
FileContainer fileContainer = imageHandler.GetPdfFile(guid, options);

// Access result PDF document using fileContainer.Stream property

Obtaining layers visibility information from CAD drawings

Prior to version 19.1, GroupDocs.Viewer for .NET API allowed to obtain the list of layer names. This feature provides you with the ability to render certain layers. Since version 19.1, along with the layer name you are getting layer visibility status (visible/invisible) as well. The layers are invisible when they are frozen or switched off in the original CAD drawing, otherwise, they are visible. This additional information allows deciding which layer to render relying on layer visibility status. The example below shows how to get layers visibility status:

Obtaining the list of all existing layers from CAD document

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

// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
string guid = "withLayers.dwg";

CadDocumentInfoContainer documentInfo = (CadDocumentInfoContainer) imageHandler.GetDocumentInfo(guid);

// Loop through all layers contained in the drawing
foreach (CadLayer layer in documentInfo.Layers)
    Console.WriteLine("Layer name and visibility: {0}-{1}", layer.Name, layer.Visible);

List of Changes in v19.1

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

GroupDocs.Viewer.Config.ViewerConfig

public string LocalesPath property has been set as obsolete

This property is obsolete and will be removed after v19.2. GroupDocs.Viewer no longer provides localization supports.

GroupDocs.Viewer.Handler.Cache.ICacheDataHandler

public DateTime? GetLastModificationDate method has been set as obsolete

This property is obsolete and will be removed after v19.3. GroupDocs.Viewer will no longer rely on document last modification date while caching or retrieving render results from cache.