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
Key | Category | Summary |
---|---|---|
VIEWERNET-4185 | Feature | Add Unix CPIO Archive (.CPIO) file-format support |
VIEWERNET-4183 | Feature | Add Design Web Format XPS File (.dwfx) file-format support |
VIEWERNET-3520 | Feature | Autodetect of the text file encoding |
VIEWERNET-4211 | Feature | Optimize (compress) PDF file when exporting Excel Spreadsheets |
VIEWERNET-4180 | Feature | Add Autodesk FBX Interchange File (.FBX) file-format support |
VIEWERNET-4203 | Enhancement | Add SkiaSharp.NativeAssets.Linux.NoDependencies as a package dependency |
VIEWERNET-4182 | Enhancement | Call Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) when it is required |
VIEWERNET-2918 | Fix | Out of memory with CGM |
VIEWERNET-3988 | Fix | Unexpected font parsing exception |
VIEWERNET-4090 | Fix | Out of memory exception when rendering PDF on Linux |
VIEWERNET-4089 | Fix | PDF is displayed in black on Linux |
VIEWERNET-3979 | Fix | GroupDocs under Linux environment crashes with a PDF file |
VIEWERNET-4213 | Fix | Viewer is not rendering all pages on Azure deployment and local inconsistently |
VIEWERNET-4061 | Fix | Can’t view ICO file |
VIEWERNET-3802 | Fix | “Could not load file. File is corrupted or damaged.” exception when rendering ODT file |
VIEWERNET-3160 | Fix | Image missing in rendered page in Linux |
VIEWERNET-3283 | Fix | Out of memory exception when rendering PDF file in Docker |
VIEWERNET-3222 | Fix | Out of memory exception when rendering PDF file on Linux |
VIEWERNET-3800 | Fix | “Could not load file. File is corrupted or damaged.” exception when rendering ODT file |
VIEWERNET-4214 | Fix | Options is not OdRasterizationOptions when exporting ODG to HTML |
VIEWERNET-4208 | Fix | MBOX rendered without images |
VIEWERNET-4181 | Fix | Autodesk FBX Interchange File (.FBX) not working with ASCII format |
VIEWERNET-4193 | Fix | GroupDocs.Viewer for .NET: WPF demo with DOCX format is broken |
VIEWERNET-4192 | Fix | GroupDocs.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
- Added support for Design Web Format XPS (.dwfx) File
- Autodetect of the text file encoding
- Added support for Autodesk FBX Interchange File
- Add SkiaSharp.NativeAssets.Linux.NoDependencies as a package dependency
- Optimize (compress) PDF file when exporting Excel Spreadsheets
- .NET 6 DLL removed from the package
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.
System.Text.Encoding.Default
to System.Text.Encoding.UTF8
.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.
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.
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance)
ensures that an instance of a provider is registered only once, so it is safe to call this method multiple times..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.