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
Key | Category | Summary |
---|---|---|
VIEWERNET‑4330 | Feature | Support PDF file optimizations |
VIEWERNET‑4249 | Feature | Support retrieving view info when rendering to PDF |
VIEWERNET‑3562 | Fix | Converting particular PDF to HTML is throwing an exception |
VIEWERNET‑4356 | Fix | High memory usage, long processing time creating thumbnail for spreadsheet |
VIEWERNET‑4311 | Fix | System.NullReferenceException when trying to view a PST file as PDF |
VIEWERNET‑4323 | Fix | DOCX to PNG: Application consumes all available memory |
VIEWERNET‑4248 | Fix | Aspose.PDF dependency creates temp files |
VIEWERNET‑2428 | Fix | Incorrect position of images and characters in a docx file |
VIEWERNET‑4120 | Fix | SetLicense is not working with renewed license |
VIEWERNET‑4385 | Fix | PDF file loading slow (.Net Core project) |
VIEWERNET‑4358 | Fix | A workbook must contain at least a visible worksheet |
VIEWERNET‑4023 | Fix | Presentation Text with 3D effect incorrectly rendered on Linux |
VIEWERNET‑4138 | Fix | Empty <title> tags being created when loading PDF and EPub documents |
Major Features
This release includes two features:
- Added support for PDF file optimizations
- Added support for retrieving view info when rendering to PDF
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.