GroupDocs.Viewer for .NET 22.9 Release Notes

Major Features

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

  • Added support for setting page size and margings when rendering Web documents
  • Rendering encrypted RAR5 archives is now supported

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-4064Set page size when rendering Web documentsFeature
VIEWERNET-2692Out of memory exception thrown when rendering MD file to PNG/JPG in LinuxBug
VIEWERNET-3367Exception Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index when opening CGM-file.Bug
VIEWERNET-3498“Could not load file. File is corrupted or damaged.” exception when rendering DWF fileBug
VIEWERNET-3588“Index was out of range. Must be non-negative and less than the size of the collection. (Parameter ‘startIndex’)” exception when rendering NUMBERS fileBug
VIEWERNET-3597UpdateSize produces wrong size for specific DWG documentBug
VIEWERNET-3601Table border is not correct when converting certain DOCX to HTML in .NETBug
VIEWERNET-3739Temp files are not removed when Viewer fails to load CDRBug
VIEWERNET-3820“Could not load file. File is corrupted or damaged.” exception when rendering ODT fileBug
VIEWERNET-3874“Could not load file. File is corrupted or damaged.” exception when rendering ODT fileBug
VIEWERNET-3916Cannot open RAR5 encrypted file in .NET 6Bug
VIEWERNET-3967Size options were not applied when converting CAD documentsBug
VIEWERNET-4000Saving a particular pdf document to image by page produces distored imagesBug
VIEWERNET-4117DXF Image loading failedBug

Public API changes

We’ve allocated options for rendering Web documents into a separate WedDocumentOptions class to simplify public API and make it more specific. Previously users have to WordProcessingOptions which was not intuitive.

namespace GroupDocs.Viewer.Options
{
    /// <summary>
    /// This rendering options enables you to customize the appearance of
    /// the output HTML/PDF/PNG/JPEG when rendering Web documents.
    /// </summary>
    public class WebDocumentOptions
    {
        /// <summary>
        /// The size of the output page.
        /// The default value is <see cref="GroupDocs.Viewer.Options.PageSize.Letter"/> 792 x 612 points.
        /// <remarks>
        /// When contents does not fit set a larger page size e.g. <see cref="GroupDocs.Viewer.Options.PageSize.A3"/>.
        /// </remarks>
        /// </summary>
        public PageSize PageSize { get; set; }

        /// <summary>
        /// The distance (in points) between the left edge of the page and the left boundary of the body text.
        /// The default value is 5 points.
        /// </summary>
        public float LeftMargin { get; set; }

        /// <summary>
        /// The distance (in points) between the right edge of the page and the right boundary of the body text.
        /// The default value is 5 points.
        /// </summary>
        public float RightMargin { get; set; }

        /// <summary>
        /// The distance (in points) between the top edge of the page and the top boundary of the body text.
        /// The default value is 72 points.
        /// </summary>
        public float TopMargin { get; set; }

        /// <summary>
        /// The distance (in points) between the bottom edge of the page and the bottom boundary of the body text.
        /// The default value is 72 points.
        /// </summary>
        public float BottomMargin { get; set; }

        /// <summary>
        /// Provides options for rendering word processing documents.
        /// </summary>
        public WebDocumentOptions()
        {
            LeftMargin = 5f;
            RightMargin = 5f;
            TopMargin = 72f;
            BottomMargin = 72f;
        }
    }
}

The following example demonstrates how to set Web document options when rendering HTML file to PDF:

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

using (var viewer = new Viewer("Invoice.htm"))
{
    // Create a PDF file for with page size set to A3 1190 x 842 points.
    var viewOptions = new PdfViewOptions("output.pdf");
    viewOptions.WebDocumentOptions.PageSize = PageSize.A3; 
    viewer.View(viewOptions);
}