Latest release (February 2024)
Full list of changes in this release
Key | Summary | Category |
---|---|---|
VIEWERNET-4185 | Add Unix CPIO Archive (.CPIO) file-format support | Feature |
VIEWERNET-4183 | Add Design Web Format XPS File (.dwfx) file-format support | Feature |
VIEWERNET-3520 | Autodetect of the text file encoding | Feature |
VIEWERNET-4211 | Optimize (compress) PDF file when exporting Excel Spreadsheets | Feature |
VIEWERNET-4180 | Add Autodesk FBX Interchange File (.FBX) file-format support | Feature |
VIEWERNET-4283 | Add Amazon AZW3/KF8 ebook (.azw3) file-format support | Feature |
VIEWERNET-4272 | Highlight search text in file preview | Feature |
VIEWERNET-4212 | Support for setting margins when exporting Excel Spreadsheets to PDF | Feature |
VIEWERNET-4312 | [GroupDocs.Viewer.UI] Option to disable print | Feature |
VIEWERNET-4280 | [GroupDocs.Viewer.UI] Check if license file exists in the application folder | Feature |
VIEWERJAVA-3318 | Make it possible to accept string values instead of “Color” for methods setColor and setBackgroundColor | Feature |
VIEWERJAVA-3319 | Make it possible to accept an integer values instead of “TimeZone” for method setTimeZoneOffset | Feature |
VIEWERJAVA-3208 | Improved performance when rendering DWF document | Enhancement |
VIEWERJAVA-3212 | Improved performance when viewing specific DWF document as HTML | Enhancement |
VIEWERNET-2918 | Out of memory with CGM | Fix |
VIEWERNET-3988 | Unexpected font parsing exception | Fix |
VIEWERNET-4090 | Out of memory exception when rendering PDF on Linux | Fix |
VIEWERNET-4089 | PDF is displayed in black on Linux | Fix |
VIEWERNET-3979 | GroupDocs under Linux environment crashes with a PDF file | Fix |
VIEWERNET-4213 | Viewer is not rendering all pages on Azure deployment and local inconsistently | Fix |
VIEWERNET-4061 | Can’t view ICO file | Fix |
VIEWERNET-3802 | “Could not load file. File is corrupted or damaged.” exception when rendering ODT file | Fix |
VIEWERNET-3160 | Image missing in rendered page in Linux | Fix |
VIEWERNET-3283 | Out of memory exception when rendering PDF file in Docker | Fix |
VIEWERNET-3222 | Out of memory exception when rendering PDF file on Linux | Fix |
VIEWERNET-3800 | “Could not load file. File is corrupted or damaged.” exception when rendering ODT file | Fix |
VIEWERNET-4214 | Options is not OdRasterizationOptions when exporting ODG to HTML | Fix |
VIEWERNET-4208 | MBOX rendered without images | Fix |
VIEWERNET-4181 | Autodesk FBX Interchange File (.FBX) not working with ASCII format | Fix |
VIEWERNET-2646 | The image was cut when rendering from PDF with images in Linux | Fix |
VIEWERNET-2823 | Invalid image block length | Fix |
VIEWERNET-3015 | Mobi file detected as damaged | Fix |
VIEWERNET-4152 | Operation is not valid due to the current state of the object when rendering Excel spreadsheet to PNG | Fix |
VIEWERNET-4243 | Slow Load time in Viewer | Fix |
VIEWERNET-4246 | Object reference not set to an instance of an object? error occurs when converting this excel file | Fix |
VIEWERNET-4250 | Font not embedded when converting DOCX to HTML | Fix |
VIEWERNET-4260 | The type initializer for ‘Gdip’ threw an exception when rendering PDF | Fix |
VIEWERNET-4263 | Object reference not set to an instance of an object exception when rendering DOCX file | Fix |
VIEWERNET-4266 | Converting STL files to HTML produces empty file | Fix |
VIEWERNET-4324 | Links are covered after rendering | Fix |
VIEWERNET-4322 | AI file can’t be opened | Fix |
VIEWERNET-4318 | PPTX showing headers when ExcludeFonts | Fix |
VIEWERNET-4319 | Viewer fails to open DIB file | Fix |
VIEWERNET-4328 | OneNote embedded drawing is missing | Fix |
VIEWERJAVA-3109 | Viewer converts DXF document to empty HTML file | Fix |
VIEWERJAVA-3186 | Failed rendering DWFX document as PDF | Fix |
VIEWERJAVA-3096 | Failed rendering DWFX document as JPG | Fix |
VIEWERJAVA-3122 | Failed rendering DWFX document as PNG | Fix |
VIEWERJAVA-3109 | Viewer converts DXF document to empty HTML file | Fix |
VIEWERJAVA-3121 | Error when rendering DWF document as HTML with embedded resources | Fix |
VIEWERJAVA-3127 | An image is wrong when rendering specific PDF file | Fix |
VIEWERJAVA-3136 | NullPointerException is thrown when loading specific DWG document | Fix |
VIEWERJAVA-3144 | Exception is thrown when try to view DGN document as HTML with SVG inside | Fix |
Major Features
This release includes next features and enhancement:
- Added support for Unix CPIO archives
- Added support for Design Web Format XPS (.dwfx) File
- Autodetect of the text file encoding
- Added support for Autodesk FBX Interchange File
- Optimize (compress) PDF file when exporting Excel Spreadsheets
- Added support for Amazon AZW3/KF8 ebook
- Support for setting margins when exporting Excel Spreadsheets to PDF
- Option to disable print
- Check if license file exists in the application folder
Public API and backward incompatible changes
Added support for Unix CPIO archives
CPIO is archive file. This archive format is used by RPM, the Linux kernel initramfs
, and Apple’s pax
archive installer.
/**
* Cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems.
* Learn more about this file format <a href="https://wiki.fileformat.com/compression/cpio">here</a>.
*/
CPIO("Unix CPIO Archive", ".cpio")
Added support for Design Web Format XPS (.dwfx) File
DWFX is secure file format developed by Autodesk to combine and publish rich 2D- and 3D-design data.
/**
* <p>
* Represents a Design Web Format File XPS (.dwfx), which is a compressed format for viewing, reviewing, or printing 2D/3D drawings as an XPS document. It contains graphics and text as part of the design data and reduces the file size due to compression.
* Learn more about this file format <a href="https://wiki.fileformat.com/cad/dwfx">here</a>.
* </p>
*/
DWFX("Design Web Format File XPS", ".dwfx")
Autodetect of the text file encoding
GroupDocs.Viewer can automatically detect text (TXT, CSV, TSV) files charset. When Viewer fails to detect a file encoding it falls back to the default encoding specified in LoadOptions#getCharset().
Charset.defaultCharset()
to StandardCharsets.UTF_8
.To enable encoding autodetect set LoadOptions#setDetectCharset(boolean)
property to true
.
LoadOptions loadOptions = new LoadOptions();
loadOptions.setDetectCharset(true);
try (Viewer viewer = new Viewer("employees.csv", loadOptions)) {
// Convert the spreadsheet to HTML.
// {0} is replaced with the current page number in the file names.
HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources("page_{0}.html");
viewer.view(viewOptions);
}
In addition you can use two new methods of the FileType class to detect charset of your text files.
// Detect encoding from a file path
Charset charset1 = FileType.detectCharset("employees.csv");
// Detect encoding from a stream
InputStream stream = Files.newInputStream(Paths.get("employees.csv"));
Charset charset2 = FileType.detectCharset(stream);
Added support for Autodesk FBX Interchange File
FBX file is a format used to exchange 3D geometry and animation data. FBX files are used in film, game, and Augmented Reality and Virtual Reality (AR/VR) development.
/**
* <p>
* Represents an Autodesk FBX Interchange File (FilmBoX) (.fbx), which is a 3D model format.
* Learn more about this file format <a href="https://wiki.fileformat.com/cad/fbx">here</a>.
* </p>
*/
FBX("Autodesk FBX Interchange File (FilmBoX)", ".fbx")
Optimize (compress) PDF file when exporting Excel Spreadsheets
You can optimize output PDF file size when exporting spreadsheets. Optimized PDF document won’t contain common fonts like Times New Roman and Arial. Grid lines is also optimized to reduce output file size. Depending on the content of the input spreadsheet the output PDF size can be reduced up to 40%. To optimize the output PDF set PdfViewOptions#setOptimize(boolean) property to true
.
try (Viewer viewer = new Viewer("employees.xlsx")) {
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.setOptimize(true);
viewer.view(viewOptions);
}
The following image shows the properties of two PDF files where the left one is not optimized and has a size of 11.2 MB and the right one is 6.6 MB.
Added support for Amazon AZW3 ebook
AZW3 is ebook file. This ebook format is used by Amazon Kindle, this file format is developed for Amazon Kindle devices. The format is an enhancement to older AZW files and is used on Kindle Fire devices only with backward compatibility for the ancestor file format i.e. MOBI and AZW.
/**
* <p>
* Amazon Kindle Format 8 (KF8) ebook is the digital file format developed for Amazon Kindle devices. The format is an enhancement to older AZW files and is used on Kindle Fire devices only with backward compatibility for the ancestor file format i.e. MOBI and AZW.
* Learn more about this file format <a href="https://wiki.fileformat.com/ebook/azw3">here</a>.
* </p>
*/
AZW_3("Amazon Kindle Format 8 (KF8) eBook", ".azw3")
Support for setting margins when exporting Excel Spreadsheets to PDF
If convert from Excel workbook to the Pdf now optional margins can be applied to the output pages. If margin value is less than 0 or not set then it will be set to the default value.
try (Viewer viewer = new Viewer("invoice.xlsx")) {
PdfViewOptions viewOptions = new PdfViewOptions();
// Set margins for worksheets in the output pdf pages
viewOptions.getSpreadsheetOptions().setLeftMargin(0);
viewOptions.getSpreadsheetOptions().setRightMargin(0.5);
viewOptions.getSpreadsheetOptions().setTopMargin(1);
viewOptions.getSpreadsheetOptions().setBottomMargin(-10); // set to default value
viewer.view(viewOptions);
}
Option to disable print
GroupDocs.Viewer.UI Print button now can be disabled optionally from backend.
/// Implement the service
.setupGroupDocsViewer((viewerConfig, config) -> {
...
config.disablePrint();
...
})
Check if license file exists in the application folder
GroupDocs.Viewer.UI Check of license file in the application folder added.
Current sequence of checks:
- check license file path from config
- check path from
GROUPDOCS_LIC_PATH
environment variable - check app root folder for files with file names
GroupDocs.Viewer.lic
GroupDocs.Viewer.Product.Family.lic