Latest release (August 2024)
Full list of changes in this release
Key | Category | Summary |
---|---|---|
VIEWERNET‑4658 | Feature | Unlink table of contents in Word documents |
VIEWERNET‑3308 | Feature | Make ePub pages rendering as text, but not picture |
VIEWERNET‑4712 | Feature | Introduce new performance-oriented conversion mode for CAD format family |
VIEWERNET‑4596 | Enhancement | Scale up the output image size to 1920px by width or 1080px by height when rendering presentations to PNG/JPEG |
VIEWERNET‑4593 | Fix | Incorrect result during rendering XLSM |
VIEWERNET‑3374 | Fix | Artifacts rendered when converting PCL file |
VIEWERNET‑3602 | Fix | Get pages count for epub not work |
VIEWERNET‑4598 | Fix | Some documents not render as expected |
VIEWERNET‑4597 | Fix | Memory leak occurs when the leaveOpen parameter is set to true |
VIEWERNET‑4030 | Fix | “Image with color palette is not supported.” exception when rendering CMX file |
VIEWERNET‑4418 | Fix | Content is missing when rendering RTF file |
VIEWERNET‑3950 | Fix | Lines are too thick converting certain DWG to HTML |
VIEWERNET‑4567 | Fix | Image stretching issue |
VIEWERNET‑3968 | Fix | IFC files are rendering as black image result in Linux |
VIEWERNET‑4539 | Fix | Docx searching problem |
VIEWERNET‑3527 | Fix | “CAD document rendering failed.Please check that CadOptions sizing options do not have too low or too high values.” exception when rendering DWG file |
VIEWERNET‑3636 | Fix | Overflow HideText and OverlayIfNextIsEmpty rendering are broken |
VIEWERNET‑4244 | Fix | Image missing whilst rendering as HTML page |
VIEWERNET‑2641 | Fix | Invalid parameter exception when rendering PS file |
VIEWERNET‑2791 | Fix | Cache size is too big |
VIEWERNET‑7 | Fix | Content is shifted when rendering mht to pdf or image |
VIEWERNET‑5 | Fix | Issue in Rendering PDF Document into HTML and Image |
VIEWERNET‑11 | Fix | Text not getting displayed on browser in HTML mode |
VIEWERNET‑3605 | Fix | “File type is not supported.” exception when rendering XML excel XLS file |
VIEWERNET‑2994 | Fix | “The number greater than zero is expected. (Parameter ‘width’)” exception when rendering XLSX file |
VIEWERNET‑2851 | Fix | “Image export failed.” exception when rendering DWF file on Linux |
VIEWERNET‑3805 | Fix | “Bit depth of 8 bits are supported for RGBA images.” exception when rendering PNG file |
VIEWERNET‑3624 | Fix | “File type is not supported.” exception when rendering XLS file |
VIEWERNET‑3804 | Fix | Method not found exception when rendering MPP file |
VIEWERNET‑3811 | Fix | Method not found exception when rendering MPP file |
VIEWERNET‑3437 | Fix | “PdfFileInfo is not initialized. Use constructors with parameters or properties for initialization. (Reason: Incorrect file header)” exception when rendering IGS file |
VIEWERNET‑3265 | Fix | “The number greater than zero is expected. (Parameter ‘width’)” exception when rendering CDR file |
VIEWERNET‑2482 | Fix | “Image export failed” exception when rendering SVG file |
VIEWERNET‑3306 | Fix | “Image export failed.” exception when rendering CDR file |
VIEWERNET‑4098 | Fix | forRenderingByWidth, forRenderingByHeight, and forRenderingByScaleFactor values are ignored when rendering DWG to PDF |
VIEWERNET‑3327 | Fix | Specific DWG file loaded only when license set |
VIEWERNET‑3737 | Fix | XLS file rendered incorrect |
VIEWERNET‑4628 | Fix | EXIF metadata is not taken into account when showing JPG |
VIEWERNET‑3779 | Fix | Freeze on save when rendering ODS file |
VIEWERNET‑3331 | Fix | PDF file renders differently in Windows and Linux |
VIEWERNET‑2904 | Fix | Particular PDF to HTML rendering issue |
VIEWERNET‑3812 | Fix | Method not found exception when rendering MPP file |
VIEWERNET‑2866 | Fix | “The number greater than zero is expected. (Parameter ‘width’)” exception when rendering IFC file |
VIEWERNET‑3504 | Fix | “Unable to read beyond the end of the stream.” exception when rendering XLSX file |
VIEWERNET‑3225 | Fix | File is corrupted or damaged when rendering AI file |
VIEWERNET‑4586 | Fix | PDF to HTML: Rendering HTML raises the GroupDocsViewerException |
VIEWERNET‑4736 | Fix | The number greater than zero is expected. (Parameter ‘width’) |
VIEWERNET‑2789 | Fix | Incorrect page size |
VIEWERNET‑2758 | Fix | Missing drawing elements when converting DWG |
VIEWERNET‑3371 | Fix | The font size of superscripts does not decrease and pages grayed out when converting PS to PDF |
Major Features
This release includes the following features:
- Image size scaled up when rendering presentations to PNG and JPEG
- Automatic rotation of JPEG images based on Exif Orientation tag
- Unlink table of contents in Word documents
- Introduced new performance-oriented conversion mode for CAD format family
Image size scaled up when rendering presentations to PNG and JPEG
When rendering presentations, such as Microsoft PowerPoint Presentation (PPTX) files, the Viewer utilizes the physical dimensions of slide size. For instance, when the presentation size in PowerPoint is 13.333
inches by 7.5
inches, the output PNG or JPEG image size will be calculated using the following formula:
Width = 13.333 * 576 / 8 = 960px Height = 7.5 * 576 / 8 = 540px
Here, the value 576
corresponds to the number of pixels per inch, and 8
is a scale factor.
Applying this formula results in an output image size of 960px
x 540px
, which may appear pixelated on modern screens. To enhance image quality, we scale the output JPEG or PNG image to Full HD resolution (1920x1080) proportionally by either image width or height.
So, the formulas for the same slide change to:
Width = (13.333 * 576 / 8) * F1 = 1920px Height = (7.5 * 576 / 8) * F2 = 1080px
Note that F1
and F2
both variables have value 2
in this case. F1
and F2
values are calculated based on the source slide width and height proportionally to fit size by width or height.
Removed obsolete members
com.groupdocs.viewer.options.PdfViewOptions#getJpgQuality()
This API has been removed. Please use the following code to set image quality:
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.setPdfOptimizationOptions(new PdfOptimizationOptions());
viewOptions.getPdfOptimizationOptions().setCompressImages(true);
viewOptions.getPdfOptimizationOptions().setImageQuality(50);
Learn more about PDF optimization in Optimize the output PDF file topic.
com.groupdocs.viewer.options.PdfViewOptions#isOptimize()
This API has been removed. Please use the following code to apply spreadsheet-specific optimizations like grid lines optimization when rendering spreadsheets to PDF:
PdfViewOptions viewOptions = new PdfViewOptions();
viewOptions.setPdfOptimizationOptions(new PdfOptimizationOptions());
viewOptions.getPdfOptimizationOptions().setOptimizeSpreadsheets(true);
Learn more about rendering spreadsheets in Optimize spreadsheets in a PDF file
Automatic rotation of JPEG images based on Exif Orientation tag
GroupDocs.Viewer for Java automatically rotates and flips JPEG images based on Exif orientation metadata. This ensures that you always see images in the correct orientation, regardless of how they were captured or stored. For instance, GroupDocs.Viewer for Java automatically rotated the following image 180 degrees to display it correctly.
Unlink table of contents in Word documents
When rendering to HTML or PDF, you can set WordProcessingOptions#setUnlinkTableOfContents(…) to true
to unlink table of contents. For HTML rendering, <a>
tags with relative links will be replaced with <span>
tags, removing functionality but preserving visual appearance. For PDF rendering, the table of contents will be rendered as plain text without links to document sections.
The code example below renders a Word document with table of contents as a plain text without links.
try (Viewer viewer = new Viewer("resume.docx")) {
// Convert the document to HTML.
HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
// Unlink table of contents.
viewOptions.getWordProcessingOptions().setUnlinkTableOfContents(true);
viewer.view(viewOptions);
}
The following image illustrates the result:
Introduced new performance-oriented conversion mode for CAD format family
By default, the GroupDocs.Viewer converts and renders all documents within CAD format family with the max possible quality. In case when the input CAD file (DWG, for example) is very complex, it may lead to quite significant processing time. Also, the size of the generated output HTML or image (vector or raster) also may be too heavy.
Starting from the version 24.8 the GroupDocs.Viewer introduces a new public property within the CadOptions
class — the setEnablePerformanceConversionMode(...)
boolean flag. By default it is set to false
- the GroupDocs.Viewer behaves as in previous versions, preserving the maximum quality. But when setting its value to true
, then the performance-oriented conversion mode is enabled, which leads to significantly lesser conversion time as well as lesser byte size of the output document.
Enabling this mode is pretty simple — just create an instance of the CadOptions
class by using any of the CadOptions factory methods, and then set the value for the setEnablePerformanceConversionMode(...)
property. Example is below:
try (Viewer viewer = new Viewer("input.dwg")) {
HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources("Output-Page#{0}.html");
viewOptions.setCadOptions(CadOptions.forRenderingByWidth(1000));
viewOptions.getCadOptions().setEnablePerformanceConversionMode(true);
viewer.view(viewOptions);
}
If taking an ordinary DWG file as a sample, the comparison between “quality” and “performance” modes are the next:
Conversion mode | Output file size, MiB | Processing time, sec |
---|---|---|
Quality-oriented (default) | 46.8 | 7.87 |
Performance-oriented (new) | 5.04 | 4.47 |
Screenshot below illustrates the visual differences between these modes, default quality-oriented mode is on the left side, and the new performance-oriented mode is on the right side: