Latest release (April 2024)
Full list of changes in this release
Key | Summary | Category |
---|---|---|
VIEWERNET‑4330 | Support PDF file optimizations | Feature |
VIEWERNET‑4249 | Support retrieving view info when rendering to PDF | Feature |
VIEWERJAVA‑3078 | Support retrieving view info when rendering to PDF | Feature |
VIEWERNET‑3562 | Converting particular PDF to HTML is throwing an exception | Fix |
VIEWERNET‑4356 | High memory usage, long processing time creating thumbnail for spreadsheet | Fix |
VIEWERNET‑4311 | NullReferenceException when trying to view a PST file as PDF | Fix |
VIEWERNET‑4323 | DOCX to PNG: Application consumes all available memory | Fix |
VIEWERNET‑4248 | Aspose.PDF dependency creates temp files | Fix |
VIEWERNET‑2428 | Incorrect position of images and characters in a docx file | Fix |
VIEWERNET‑4120 | setLicense is not working with renewed license | Fix |
VIEWERNET‑4385 | PDF file loading slow | Fix |
VIEWERNET‑4358 | A workbook must contain at least a visible worksheet | Fix |
VIEWERNET‑4023 | Presentation Text with 3D effect incorrectly rendered on Linux | Fix |
VIEWERNET‑4138 | Empty <title> tags being created when loading PDF and EPub documents | Fix |
VIEWERNET‑4236 | Exception thrown when converting certain PPTX to HTML | Fix |
VIEWERNET‑4414 | Error while opening .psd file | Fix |
VIEWERNET‑4245 | Whole PDF is rendered as a single link | Fix |
VIEWERNET‑4419 | Unable to detect password protected 7z archive | Fix |
VIEWERNET‑4421 | GroupDocs Viewer is throwing Exception “The type initializer for ’ threw an exception.” | Fix |
VIEWERNET‑4420 | Three pages instead of two when rendering DOCX file on Linux | Fix |
VIEWERNET‑2870 | “The number greater than zero is expected. (Parameter ‘width’)” exception when rendering DWF file | Fix |
VIEWERNET‑3692 | “Could not load file. File is corrupted or damaged.” exception when rendering ODS file | Fix |
VIEWERNET‑3792 | Cannot view EPS - The given key ‘Wingdings’ was not present in the dictionary. | Fix |
VIEWERNET‑3999 | Slow conversion of certain PDF to HTML | Fix |
Major Features
This release includes next features and enhancement:
- Added support for PDF file optimizations
- Added support for retrieving view info when rendering to PDF
Public API and backward incompatible changes
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.
try (Viewer viewer = new Viewer("invoice.pdf")) {
PdfViewOptions viewOptions = new PdfViewOptions();
PdfOptimizationOptions optimizationOptions = new PdfOptimizationOptions();
optimizationOptions.setLinearize(true); // Optimize PDF for web-browsers
optimizationOptions.setOptimizeSpreadsheets(true); // Optimize spreadsheets for a smaller size
optimizationOptions.setSubsetFonts(true); // Keep the characters that actually used
optimizationOptions.setRemoveAnnotations(true); // Remove annotations
optimizationOptions.setRemoveFormFields(true); // Remove form fields
optimizationOptions.setConvertToGrayScale(true); // Convert images to grayscale
optimizationOptions.setCompressImages(true); // Enable images compression
optimizationOptions.setResizeImages(true); // Enable resize images with lower resolution
optimizationOptions.setMaxResolution(150); // Set resolution for images, default value is 300
optimizationOptions.setImageQuality(30); // Set image quality, default value is 100
viewOptions.setPdfOptimizationOptions(optimizationOptions);
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.
try (Viewer viewer = new Viewer("resume.docx")) {
ViewInfoOptions viewInfoOptions = ViewInfoOptions.forPdfView();
ViewInfo viewInfo = viewer.getViewInfo(viewInfoOptions);
//Get number of pages and pages size
}
Deprecated API
The following public API is now deprecated and will be removed in the future versions.
PdfViewOptions#setJpgQuality(int)
Please use the new API to set image quality when rendering to PDF.
try (Viewer viewer = new Viewer("invoice.pdf")) {
PdfViewOptions viewOptions = new PdfViewOptions();
final PdfOptimizationOptions optimizationOptions = new PdfOptimizationOptions();
optimizationOptions.setCompressImages(true);
optimizationOptions.setImageQuality(30); // Default value is 100
viewOptions.setPdfOptimizationOptions(optimizationOptions);
viewer.view(viewOptions);
}
PdfViewOptions#setOptimize(boolean)
Please use the new API to optimize Excel spreadsheets when rendering to PDF.
try (Viewer viewer = new Viewer("inventory.xlsx")) {
PdfViewOptions viewOptions = new PdfViewOptions();
final PdfOptimizationOptions optimizationOptions = new PdfOptimizationOptions();
optimizationOptions.setOptimizeSpreadsheets(true); // Optimize Excel spreadsheets border lines and fonts
viewOptions.setPdfOptimizationOptions(optimizationOptions);
viewer.view(viewOptions);
}