GroupDocs.Viewer for .NET 23.6 Release Notes

There are 13 features and bug fixes in this release.

Full list of changes in this release

KeyCategorySummary
VIEWERNET‑4330FeatureSupport PDF file optimizations
VIEWERNET‑4249FeatureSupport retrieving view info when rendering to PDF
VIEWERNET‑3562FixConverting particular PDF to HTML is throwing an exception
VIEWERNET‑4356FixHigh memory usage, long processing time creating thumbnail for spreadsheet
VIEWERNET‑4311FixSystem.NullReferenceException when trying to view a PST file as PDF
VIEWERNET‑4323FixDOCX to PNG: Application consumes all available memory
VIEWERNET‑4248FixAspose.PDF dependency creates temp files
VIEWERNET‑2428FixIncorrect position of images and characters in a docx file
VIEWERNET‑4120FixSetLicense is not working with renewed license
VIEWERNET‑4385FixPDF file loading slow (.Net Core project)
VIEWERNET‑4358FixA workbook must contain at least a visible worksheet
VIEWERNET‑4023FixPresentation Text with 3D effect incorrectly rendered on Linux
VIEWERNET‑4138FixEmpty <title> tags being created when loading PDF and EPub documents

Major Features

This release includes two features:

Support PDF file optimizations

This feature allows you to optimize the output PDF file for a web browser or to reduce the file size using various options.

You can also optimize an existing PDF file. To do this, open it and save the resulting file, specifying the optimization parameters.

For details, see Optimize the output PDF file.

The following code snippet shows how to enable all available optimizations.

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

using (Viewer viewer = new Viewer("invoice.pdf"))
{
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
    {
        Lineriaze = true, // Optimize PDF for web-browsers
        OptimizeSpreadsheets = true, // Optimize spreadsheets for a smaller size
        SubsetFonts = true, // Keep the characters that actually used 
        RemoveAnnotations = true, // Remove annotations
        RemoveFormFields = true, // Remove form fields
        ConvertToGrayScale = true, // Convert images to grayscale
        CompressImages = true, // Enable images compression
        ResizeImages = true, // Enable resize images with lower resolution
        MaxResolution = 150, // Set resolution for images, default value is 300
        ImageQuality = 30, // Set image quality, default value is 100 
    };

    viewer.View(viewOptions);
}

Support retrieving view info when rendering to PDF

To get information about output PDF file, call the GetViewInfo method.

For details, see Get the PDF output file information.

The following code snippet shows how to get information about the output PDF file.

using (Viewer viewer = new Viewer("resume.docx"))
{
    ViewInfoOptions viewInfoOptions = ViewInfoOptions.ForPdfView();
    ViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions);

    //Get number of pages and pages size
}

Obsolete API

The following public API is now deprecated and will be removed in the future versions.

PdfViewOptions.JpgQuality

Please use the new API to set image quality when rendering to PDF.

using (Viewer viewer = new Viewer("invoice.pdf"))
{
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
    {
        CompressImages = true,
        ImageQuality = 30, // Default value is 100 
    };

    viewer.View(viewOptions);
}

PdfViewOptions.Optimize

Please use the new API to optimize Excel spreadsheets when rendering to PDF.

using (Viewer viewer = new Viewer("inventory.xlsx"))
{
    PdfViewOptions viewOptions = new PdfViewOptions();
    viewOptions.PdfOptimizationOptions = new PdfOptimizationOptions
    {
        OptimizeSpreadsheets = true // Optimize border Excel spreadsheets border lines and fonts
    };

    viewer.View(viewOptions);
}

Updates in the further version

The next version of GroupDocs.Viewer for .NET will incorporate the following major changes, some of which may have an impact on compatibility with previous versions.

Drop support for .NET Framework 4.0

Following .NET Framework Support Policy, we are dropping support for .NET Framework 4.0 in the next version of GroupDocs.Viewer. The .NET Framework 4.0 assembly will be replaced with the .NET Framework 4.6.2 assembly in the distribution packages.