GroupDocs.Viewer for .NET 20.7 Release Notes

Major Features

There are 31 features, improvements, and bug-fixes in this release, most notable are:

  • Support setting margins when converting HTML files
  • Rendering text files into a single HTML page
  • Excel 2003 XML file (SpreadsheetML) (.xml) file-format support
  • Apple numbers (.numbers) file-format support
  • WinRAR Compressed Archive (.rar) file-format support
  • Support splitting up archives into multiple pages by rows and columns
  • Support checking if a file is encrypted

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-2219Rendering text files into single HTML pageFeature
VIEWERNET-2492Support setting margins when converting HTML filesFeature
VIEWERNET-2509Add WinRAR Compressed Archive (.rar) file-format supportFeature
VIEWERNET-2535Split up archives into multiple pagesFeature
VIEWERNET-2549Add feature to identify File is Password ProtectedFeature
VIEWERNET-2575Add Apple numbers (.numbers) file-format supportFeature
VIEWERNET-2578Add Excel 2003 XML file (SpreadsheetML) (.xml) file-format supportFeature
VIEWERNET-2181Images are missing when rendering Excel as HTML/image/PDFBug
VIEWERNET-2217AutoCad rendering issueBug
VIEWERNET-2348Cannot access a disposed object error when disposing the ViewerBug
VIEWERNET-2465Exception: Image export failedBug
VIEWERNET-2470"Image export failed” exception when rendering EMF file”Bug
VIEWERNET-2484GetViewInfo consumes a lot of memoryBug
VIEWERNET-2498Overflow error on VSDX fileBug
VIEWERNET-2501Partial Worksheet rendering issueBug
VIEWERNET-2530File damaged or corrupted errorBug
VIEWERNET-2537Unable to cast object of type double to stringBug
VIEWERNET-2543VDX and VSS files rendered incorrectlyBug
VIEWERNET-2544XLSM file can’t be viewedBug
VIEWERNET-2573"File is corrupted or damaged” exception when rendring XLS file”Bug
VIEWERNET-2574Determine attached file extension in EMLBug
VIEWERNET-2580Exception is thrown when rendering XLSX fileBug
VIEWERNET-2590"Parameter is not valid” exception when rendering VSD file”Bug
VIEWERNET-2596Out of memory exceptionBug
VIEWERNET-2610Can’t view ICO fileBug
VIEWERNET-2611Can’t get document info for ICOBug
VIEWERNET-2631Exception is thrown when rendering VDX fileBug
VIEWERNET-2637Application never exits when converting SVG to PNG/JPG on LinuxBug
VIEWERNET-2638Application never exits when converting EMF to HTML on LinuxBug
VIEWERNET-2639Blank image when converting EMF to PNG on LinuxBug
VIEWERNET-2640Invalid row indexBug

Public API and Backward Incompatible Changes

Behavior changes

Changes in the public API

GroupDocs.Viewer.Viewer

Added new method GetFileInfo() and related FileInfo class to support checking if file is encrypted or not. See How to check if file is encrypted for more details and code sample.

/// <summary>
/// Returns information about file such as file-type and flag that indicates if file is encrypted.
/// </summary>
/// <returns>The file information.</returns>
/// <remarks>
/// <b>Learn more</b>
///   <list type="bullet">
///     <item>
///         Learn more about file information:
///      <a target="_blank" href="https://docs.groupdocs.com/viewer/net/how-to-check-if-file-is-encrypted/">How to check if file is encrypted</a>
///     </item>
///   </list>
/// </remarks>
public FileInfo GetFileInfo()

GroupDocs.Viewer.FileType

Three new fields added to GroupDocs.Viewer.FileType class that reflect new file formats that we’re supporting starting from v20.7.

/// <summary>
/// Roshal ARchive (.rar) are compressed files generated using the RAR (WINRAR) compression method.
/// Learn more about this file format <a href="https://wiki.fileformat.com/compression/rar">here</a>.
/// </summary>
public static readonly FileType RAR = new FileType("Rar Compressed File", ".rar");

/// <summary>
/// Excel 2003 XML (SpreadsheetML) represents Excel Binary File Format. Such files can be created by Microsoft Excel as well as other similar spreadsheet programs such as OpenOffice Calc or Apple Numbers.
/// Learn more about this file format <a href="https://wiki.fileformat.com/spreadsheet/xls">here</a>.
/// </summary>
public static readonly FileType Excel2003XML = new FileType("Excel 2003 XML (SpreadsheetML)", ".xml");

/// <summary>
/// Apple numbers represent Excel-like Binary File Format. Such files can be created by Apple numbers application.
/// Learn more about this file format <a href="https://fileinfo.com/extension/numbers">here</a>.
/// </summary>
public static readonly FileType NUMBERS = new FileType("Apple numbers", ".numbers");

GroupDocs.Viewer.Results.FileInfo

Added FileInfo class to support checking if file is encrypted or not.

/// <summary>
/// Contains information about file.
/// </summary>
[Serializable]
public class FileInfo
{
    /// <summary>
    /// The type of the file.
    /// </summary>
    public FileType FileType { get; }

    /// <summary>
    /// Indicates that file is encrypted.
    /// </summary>
    public bool Encrypted { get; set; }

    /// <summary>
    /// Initializes new instance of <see cref="FileType"/> class.
    /// </summary>
    /// <param name="fileType">The type of the file.</param>
    /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="fileType"/> is null.</exception>
    public FileInfo(FileType fileType)
    {
        if (fileType == null)
            throw new ArgumentNullException(nameof(fileType));

        FileType = fileType;
    }

    /// <summary>
    /// Returns a string that represents the current object.
    /// </summary>
    /// <returns>A string that represents the current object.</returns>
    public override string ToString()
    {
        return string.Format("{0}; Encrypted: {1}", FileType, Encrypted ? "Yes" : "No");
    }
}

GroupDocs.Viewer.Options.ArchiveOptions

The new property ItemsPerPage has been added to to GroupDocs.Viewer.Options.CadOptions class to support.

/// <summary>
/// Number of records per page (for rendering to HTML only)
/// </summary>
public int ItemsPerPage { get; set; }

GroupDocs.Viewer.Options.HtmlViewOptions

Added new property RenderSinglePage to GroupDocs.Viewer.Options.HtmlViewOptions class to support rendering text files to a single page see Rendering text files into a single HTML page for more details.

/// <summary>
/// Enables HTML content will be rendered to single page
/// </summary>
public bool RenderSinglePage { get; set; }

GroupDocs.Viewer.Options.SpreadsheetOptions

The new factory method ForSplitSheetIntoPages() and property CountColumnsPerPage has been added to GroupDocs.Viewer.Options.SpreadsheetOptions to support partial rendering of Excel spreadsheets by splitting worksheets into pages by rows and columns. See Split worksheets into pages documentation article for more details and code samples.

/// <summary>
/// The columns count to include into each page when splitting worksheet into pages.
/// </summary>
public int CountColumnsPerPage { get; private set; }

/// <summary>
/// Initializes new instance of <see cref="SpreadsheetOptions"/> for rendering sheet into pages.
/// </summary>
/// <param name="countRowsPerPage">Rows count to include into each page.</param>
/// <param name="countColumnsPerPage">Columns count to include into each page.</param>
/// <returns>New instance of <see cref="SpreadsheetOptions"/> for rendering sheet into pages.</returns>
/// <exception cref="System.ArgumentException">Thrown when <paramref name="countRowsPerPage"/> is equals or less than zero.</exception>
/// <exception cref="System.ArgumentException">Thrown when <paramref name="countColumnsPerPage"/> is equals or less than zero.</exception>
public static SpreadsheetOptions ForSplitSheetIntoPages(int countRowsPerPage, int countColumnsPerPage)

GroupDocs.Viewer.Options.WordProcessingOptions

Added new properties to GroupDocs.Viewer.Options.WordProcessingOptions class to support setting margins when rendering Web documents see How to convert and view HTML files with user defined margins documentation article for more details and code samples.

/// <summary>
/// Left page margin (for HTML rendering only)
/// </summary>
public float LeftMargin { get; set; }

/// <summary>
/// Right page margin (for HTML rendering only)
/// </summary>
public float RightMargin { get; set; }

/// <summary>
/// Top page margin (for HTML rendering only)
/// </summary>
public float TopMargin { get; set; }

/// <summary>
/// Bottom page margin (for HTML rendering only)
/// </summary>
public float BottomMargin { get; set; }