GroupDocs.Viewer for .NET 23.1 Release Notes

There are 20+ features, enhancements, and bug fixes in this release.

Full list of changes in this release

KeyCategorySummary
VIEWERNET-4185FeatureAdd Unix CPIO Archive (.CPIO) file-format support
VIEWERNET-4183FeatureAdd Design Web Format XPS File (.dwfx) file-format support
VIEWERNET-3520FeatureAutodetect of the text file encoding
VIEWERNET-4211FeatureOptimize (compress) PDF file when exporting Excel Spreadsheets
VIEWERNET-4180FeatureAdd Autodesk FBX Interchange File (.FBX) file-format support
VIEWERNET-4203EnhancementAdd SkiaSharp.NativeAssets.Linux.NoDependencies as a package dependency
VIEWERNET-4182EnhancementCall Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) when it is required
VIEWERNET-2918FixOut of memory with CGM
VIEWERNET-3988FixUnexpected font parsing exception
VIEWERNET-4090FixOut of memory exception when rendering PDF on Linux
VIEWERNET-4089FixPDF is displayed in black on Linux
VIEWERNET-3979FixGroupDocs under Linux environment crashes with a PDF file
VIEWERNET-4213FixViewer is not rendering all pages on Azure deployment and local inconsistently
VIEWERNET-4061FixCan’t view ICO file
VIEWERNET-3802Fix“Could not load file. File is corrupted or damaged.” exception when rendering ODT file
VIEWERNET-3160FixImage missing in rendered page in Linux
VIEWERNET-3283FixOut of memory exception when rendering PDF file in Docker
VIEWERNET-3222FixOut of memory exception when rendering PDF file on Linux
VIEWERNET-3800Fix“Could not load file. File is corrupted or damaged.” exception when rendering ODT file
VIEWERNET-4214FixOptions is not OdRasterizationOptions when exporting ODG to HTML
VIEWERNET-4208FixMBOX rendered without images
VIEWERNET-4181FixAutodesk FBX Interchange File (.FBX) not working with ASCII format
VIEWERNET-4193FixGroupDocs.Viewer for .NET: WPF demo with DOCX format is broken
VIEWERNET-4192FixGroupDocs.Viewer for .NET: WPF demo with SVG and DWG formats has a blank window

Major Features

This release includes three features and one enhancement:

Added support for Unix CPIO archives

CPIO is archive file. This archive format is used by RPM, the Linux kernel initramfs, and Apple’s pax archive installer.

/// <summary>
/// Unix CPIO Archive
/// </summary>
public static readonly FileType CPIO = new FileType("Unix CPIO Archive", ".cpio");

Added support for Design Web Format XPS (.dwfx) File

DWFX is secure file format developed by Autodesk to combine and publish rich 2D- and 3D-design data.

 /// <summary>
 /// Design Web Format File XPS (.dwfx) represents 2D/3D drawing as XPS document in compressed format for viewing, reviewing or printing design files. It contains graphics and text as part of design data and reduce the size of the file due to its compressed format.
 /// Learn more about this file format <a href="https://wiki.fileformat.com/cad/dwfx">here</a>.
 /// </summary>
 public static readonly FileType DWFX = new FileType("Design Web Format File XPS", ".dwfx");

Autodetect of the text file encoding

GroupDocs.Viewer can automatically detect text (TXT, CSV, TSV) files enconding. When Viewer fails to detect a file encoding it falls back to the default encoding specified in LoadOptions.Encoding.

To enable encoding autodetect set DetectEncoding property to true.

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
// ...

var loadOptions = new LoadOptions();
loadOptions.DetectEncoding = true;

using (var viewer = new Viewer("employees.csv", loadOptions))
{
    // Convert the spreadsheet to HTML.
    // {0} is replaced with the current page number in the file names.
    var viewOptions = HtmlViewOptions.ForEmbeddedResources("page_{0}.html");
    viewer.View(viewOptions);
}

In addition you can use two new methods of the FileType class to detect encoding of your text files.

// Detect encoding from a file path
Encoding encoding1 = FileType.DetectEncoding("employees.csv");

// Detect encoding from a stream
Stream stream = File.OpenRead("employees.csv");
Encoding encoding2 = FileType.DetectEncoding(stream);

Added support for Autodesk FBX Interchange File

FBX file is a format used to exchange 3D geometry and animation data. FBX files are used in film, game, and Augmented Reality and Virtual Reality (AR/VR) development.

/// <summary>
/// Autodesk FBX Interchange File (FilmBoX) (.fbx) represents 3D model format.
/// Learn more about this file format <a href="https://wiki.fileformat.com/cad/fbx">here</a>.
/// </summary>
public static readonly FileType FBX = new FileType("(FilmBoX)", ".fbx");

Add SkiaSharp.NativeAssets.Linux.NoDependencies as a package dependency

GroupDocs.Viewer using SkiaSharp library to process images. When running on Linux it requires additional native assets included in SkiaSharp.NativeAssets.Linux.NoDependencies. Check .NET Standard Assembly Limitations topic for more details about Viewer’s dependencies.

Optimize (compress) PDF file when exporting Excel Spreadsheets

You can optimize output PDF file size when exporting spreadsheets. Optimized PDF document won’t contain common fonts like Times New Roman and Arial. Grid lines is also optimized to reduce output file size. Depending on the content of the input spreadsheet the output PDF size can be reduced up to 40%. To optimize the output PDF set PdfViewOptions.Optimize property to true.

using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
// ...

using (var viewer = new Viewer("employees.xlsx"))
{
    var viewOptions = new PdfViewOptions();
    viewOptions.Optimize = true;

    viewer.View(viewOptions);
}

The following image shows the properties of two PDF files where the left one is not optimized and has a size of 11.2 MB and the right one is 6.6 MB.

Not optimized and optimized PDF files comparison

Automatically register codepages encoding provider

Due to the smaller number of the supported encodings by .NET Core and .NET Viewer automatically registers Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) when it is required, for example when rendering Microsoft Word documents. Learn more about this limitation at CodePagesEncodingProvider.Instance Property.

.NET 6 DLL removed from the package

In this version, .NET 6 assembly was removed due to package size limitations. The distribution packages includes two assemblies: .NET Framework 4.0 and .NET Standard 2.1. The .NET Standard assembly can be used in .NET Core and .NET applications on Windows and Linux systems. In case you’re running your app on Linux, please check .NET Standard Assembly Limitations for limitations and dependencies.