GroupDocs.Viewer for Java 21.2 Release Notes

Major Features

There are features, improvements, and bug-fixes in this release, most notable are:

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERNET-2318Support retrieving an attachment file typeFeature
VIEWERNET-2323Include folder name when rendering archive foldersFeature
VIEWERNET-1898Add Microsoft Excel 97-2003 Template (.xlt) file format supportFeature
VIEWERNET-2351Specify filename when rendering archive filesFeature
VIEWERNET-18Add Plotter Document (.plt, .hpg) file format supportFeature
VIEWERNET-2222Show spreadsheet column headings and row numbersFeature
VIEWERNET-2392Set background color when viewing CAD DrawingsFeature
VIEWERNET-125Support viewing MS Project documents with notesFeature
VIEWERNET-2034Add OpenDocument Flat XML Presentation (.fodp) file format supportFeature
VIEWERNET-2046Add Flat XML ODF Template (.fodg) file format supportFeature
VIEWERNET-2057Convert CAD drawings to SVGFeature
VIEWERNET-2059Add IGES Drawing File (.igs) format supportFeature
VIEWERNET-2243Add Common File (.cf2) format supportFeature
VIEWERNET-2311Add Wavefront 3D Object File (.obj) file-format supportFeature
VIEWERNET-2485Get sheet names from an Excel fileFeature
VIEWERNET-2222Show spreadsheet column headings and row numbersFeature
VIEWERNET-2474Support file format detection for passed streamFeature
VIEWERNET-2219Rendering text files into single HTML pageFeature
VIEWERNET-2492Support setting margins when converting HTML filesFeature
VIEWERNET-2509Add WinRAR Compressed Archive (.rar) file-format supportFeature
VIEWERNET-2535Split up archives into multiple pagesFeature
VIEWERNET-2549Add feature to identify if file is Password ProtectedFeature
VIEWERNET-2575Add Apple numbers (.numbers) file-format supportFeature
VIEWERNET-2578Add Excel 2003 XML (SpreadsheetML) (.xml) file-format supportFeature
VIEWERNET-2324Recreate output files and resources instead of writing overImprovement
VIEWERNET-2155Reduce margins when rendering LaTeX (.tex) filesImprovement
VIEWERNET-2355Return unknown file type when passing null or empty string as extension or media typeImprovement
VIEWERNET-2356Accept attachment object instead of attachment IDImprovement
VIEWERNET-316Support viewing Design Web Format File (.dwf) layersImprovement
VIEWERNET-2387Display Inbox folder by default when viewing personal storage PST/OST filesImprovement
VIEWERNET-2433Improve default font support when converting PowerPoint filesImprovement
VIEWERNET-2468Improved rendering Outlook files (pst, ost) to HTMLImprovement
VIEWERJAVA-2449Implement possibility to use custom serialization for cachingImprovement
VIEWERNET-8Overlapping Characters in Safari for iOSBug
VIEWERNET-226Files being created in Windows temp folderBug
VIEWERNET-257Incorrect rendering of DWG file as imageBug
VIEWERNET-1202Invalid characters while viewing rendered HTML in IEBug
VIEWERNET-2175STL file is rendered into blank HTML or imageBug
VIEWERNET-2306Issue in rendering/converting email attachmentsBug
VIEWERNET-2319Archive file name is missing when passing file streamBug
VIEWERNET-2320getViewInfo hangs indefinitely Bug
VIEWERNET-2321ArchiveViewInfo shows that current folder is sub-folder of itselfBug
VIEWERNET-2343Document viewer size discrepancy Bug
VIEWERNET-86setDefaultFontName(…) setting is not working for rendering Word Processing documents into HTMLBug
VIEWERNET-2120Page size is 0 for HTML modeBug
VIEWERNET-2347The number greater than zero is expected exceptionBug
VIEWERNET-2352Output shows compressed file content/data as Compressed Word FileBug
VIEWERNET-2180Drawing objects are missing when rendering Word document as HTMLBug
VIEWERNET-2317Docx to Html conversion issue, unit degree is missing in resultant fileBug
VIEWERNET-2322Japanese Space is showing as linesBug
VIEWERNET-2325PDF with watermark to HTML rendering issueBug
VIEWERNET-2344PPTX-file with RTL text inside renders incorrectly.Bug
VIEWERNET-258Exception when rendering DWG file as imageBug
VIEWERNET-2125Same result when rendering presentation without and with excluded fontBug
VIEWERNET-2285Link represented as span when rendering PDF into HTMLBug
VIEWERNET-2424File is corrupted or damaged exception when converting MPX fileBug
VIEWERNET-2434High RAM consumption issue when rendering a large text fileBug
VIEWERNET-2466Rendering Archive to PDF does not show certain charactersBug
VIEWERNET-2473Exception is thrown when rendering SVG fileBug
VIEWERNET-2480“Image export failed” exception when rendering WMF fileBug
VIEWERNET-2494“Input string was not in a correct format” exception when rendering XLSXBug
VIEWERNET-2496“Parameter is not valid” exception when rendering VSDX fileBug
VIEWERNET-2497“Unable to read beyond the end of the stream” exception when rendering ICO fileBug
VIEWERNET-2503“File is corrupted or damaged” exception when rendring CSV fileBug
VIEWERNET-2505Exception: Invalid start row index on XLSB fileBug
VIEWERNET-2529HTML representation generating stuckBug
VIEWERNET-2533The row index should not be inside the pivottable reportBug
VIEWERNET-2532Not null and not empty string is expectedBug
VIEWERNET-2430Saving email attachment using Viewer API shows evaluation tagBug
VIEWERNET-2181Images are missing when rendering Excel as HTML/image/PDFBug
VIEWERNET-2217AutoCad rendering issueBug
VIEWERNET-2348Cannot access a disposed object error when disposing the ViewerBug
VIEWERNET-2465Exception: Image export failedBug
VIEWERNET-2470“Image export failed” exception when rendering EMF file"Bug
VIEWERNET-2484getViewInfo consumes a lot of memoryBug
VIEWERNET-2498Overflow error on VSDX fileBug
VIEWERNET-2501Partial Worksheet rendering issueBug
VIEWERNET-2530File damaged or corrupted errorBug
VIEWERNET-2537Unable to cast object of type double to stringBug
VIEWERNET-2543VDX and VSS files rendered incorrectlyBug
VIEWERNET-2544XLSM file can’t be viewedBug
VIEWERNET-2573“File is corrupted or damaged” exception when rendring XLS fileBug
VIEWERNET-2574Determine attached file extension in EMLBug
VIEWERNET-2580Exception is thrown when rendering XLSX fileBug
VIEWERNET-2590“Parameter is not valid” exception when rendering VSD fileBug
VIEWERNET-2596Out of memory exceptionBug
VIEWERNET-2610Can’t view ICO fileBug
VIEWERNET-2611Can’t get document info for ICOBug
VIEWERNET-2631Exception is thrown when rendering VDX fileBug
VIEWERNET-2637Application never exits when converting SVG to PNG/JPG on LinuxBug
VIEWERNET-2638Application never exits when converting EMF to HTML on LinuxBug
VIEWERNET-2639Blank image when converting EMF to PNG on LinuxBug
VIEWERNET-2640Invalid row indexBug
VIEWERJAVA-2376PPTX to HTML has a title on page top that is not in the original documentBug

Public API and Backward Incompatible Changes

In version 21.2 following changes in public API were made:

Changes in PdfOptions class

New methods were added to PdfOptions class

    class PdfOptions {
        /*
         * When this option enabled the output pages will have the same size
         * in pixels as page size in a source PDF document.
         * By default GroupDocs.Viewer calculates output image page size for better rendering quality.
         * Note: This option is supported when rendering into PNG or JPG formats.
         */
        void setEnableFontHinting(boolean value)
        boolean isRenderOriginalPageSize()
    }

Changes in FileType class

New constants and methods were added to FileType class.

More details and use cases can be found in How to determine file type documentation article.

    enum FileType {
        /*
         * Gnu Zipped File (.gz)
         */
        GZ("Gnu Zipped File", ".gz")

        /*
         * Gnu Zipped File (.gzip)
         */
        GZIP("Gnu Zipped File", ".gzip")

        /*
         * Microsoft Excel Template (.xlt)
         */
        XLT("Microsoft Excel Template", ".xlt")
        /*
         * Roshal ARchive (.rar) are compressed files generated using the RAR (WINRAR version 4) compression method.
         */
        RAR("Rar Compressed File", ".rar")

        /*
         * Excel 2003 XML (SpreadsheetML) represents Excel Binary File Format.
         * Such files can be created by Microsoft Excel as well as other similar spreadsheet programs such as OpenOffice Calc or Apple Numbers.
         */
        EXCEL_2003_XML("Excel 2003 XML (SpreadsheetML)", ".xml")

        /*
         * Apple numbers represent Excel-like Binary File Format. Such files can be created by Apple numbers application.
         */
        NUMBERS("Apple numbers", ".numbers")
     
        /*
         * Maps file media type to file type e.g. 'application/pdf' will be mapped to `FileType.PDF`/>.
         * If `null` or `empty` was passed, it returns `FileType.Unknown` file type
         * @param mediaType File media type e.g. application/pdf.
         * @return corresponding media type when found, otherwise returns default `UNKNOWN` file type.
         */
        FileType fromMediaType(String mediaType)

        /*
         * This method now accepts `null` or `empty` string and returns `FileType.Unknown` file type instead of throwing `InvalidArgumentException`.
         */
        FileType fromExtension(String)
        /*
         * Detects file type by reading the file signature.
         * @param source The file stream.
         * @return Returns file type in case it was detected successfully otherwise returns default `FileType.Unknown` file type.
         */
        FileType fromStream(InputStream source)
        /*
         * Detects file type by reading the file signature.
         * @param source The file stream.
         * @param password The password to open the file.
         * @return Returns file type in case it was detected successfully otherwise returns default `FileType.Unknown` file type.
         */
        FileType fromStream(InputStream source, String password)
    }

Changes in ArchiveOptions class

New methods were added to ArchiveOptions

    class ArchiveOptions {
        /*
         * Methods were added to display in the header. By default, the name of the source file is displayed.
         */
        FileName getFileName()
        void setFileName(FileName fileName)

        /*
         * Methods were added to specify the number of records per page (for rendering to HTML only)
         */
        int getItemsPerPage()
        void setItemsPerPage(int)
    }

Added FileName class

Class FileName was added to represent the name of the file.

    class FileName {
        /**
         * The empty filename.
         */
        static EMPTY("<empty>")
        /**
         * The name of the source file.
         */
        static SOURCE("<source>")

        /**
         * Initializes new instance of FileName class.
         *
         * @param fileName The name of the file.
         */
        public FileName(String fileName)

        /**
         * Returns a string that represents the current object.
         */
        String toString()
    }

Changes in Attachment class

New constructor was added to Attachment class

    class Attachment {
        /*
         * Initializes new instance of attachment class.
         * @param fileName file name.
         */
        public Attachment(String fileName)
    }

Changes in Viewer class

New methods were added to Viewer class See How to check if file is encrypted for more details and code sample.

    class Viewer {
        /*
         * Method was set as deprecated. And will removed in future releases. Please switch to the method that accepts Attachment as a first parameter.
         */
        void saveAttachment(String attachmentId, OutputStream destination)

        /*
         * Method added to save attachment file to the destination stream.
         * @param attachment The attachment.
         * @param destination The writable stream.
         */
        void saveAttachment(Attachment attachment, OutputStream destination)

        /*
        * Added new method to support checking if file is encrypted or not.
        * Returns information about file such as file-type and flag that indicates if file is encrypted.
        */
        FileInfo getFileInfo()
    }

Changes in CadOptions class

New methods were added to CadOptions class

    class CadOptions {
        /*
         * Image background color
         */
        Color getBackgroundColor()
        void setBackgroundColor(Color color)
    }

Changes in SpreadsheetOptions class

New methods were added to SpreadsheetOptions class See Split worksheets into pages documentation article for more details and code samples.

    class SpreadsheetOptions {
        /*
         * Enables headings rendering.
         */
        boolean isRenderHeadings()
        void setRenderHeadings(boolean render)

        /*
         * Initializes new instance of `SpreadsheetOptions` for rendering sheet into pages.
         * @param countRowsPerPage Rows count to include into each page.
         * @param countColumnsPerPage Columns count to include into each page.
         */
        SpreadsheetOptions forSplitSheetIntoPages(int countRowsPerPage, int countColumnsPerPage)

        /*
         * The method was added to support partial rendering of Excel spreadsheets by splitting worksheets into pages by rows and columns.
         * The columns count to include into each page when splitting worksheet into pages.
         */
        int getCountColumnsPerPage()
    }

Added FileInfo class

Class FileInfo was added to support checking if file is encrypted or not.

/*
 * Contains information about file.
 */
class FileInfo {

    /*
    * The type of the file.
    */
    FileType getFileType()
    /*
     * Indicates that file is encrypted.
     */
    boolean isEncrypted()
    void setEncrypted(boolean)

    /*
    * Returns a string that represents the current object.
    */
    String toString()
}

Changes in HtmlViewOptions class

New methods were added to HtmlViewOptions class For more details see Rendering text files into a single HTML page.

    class HtmlViewOptions {
        /*
         * Methods were added to support rendering text files to a single page
         * Enables HTML content will be rendered to single page
         */
        boolean isRenderSinglePage()
        void setRenderSinglePage(boolean)
    }

Changes in WordProcessingOptions class

New methods were added to WordProcessingOptions class to support setting margins when rendering Web documents. See How to convert and view HTML files with user defined margins documentation article for more details and code samples.

    class WordProcessingOptions {

        /*
         * Left page margin (for HTML rendering only)
         */
        float getLeftMargin()
        void setLeftMargin(float)

        /*
         * Right page margin (for HTML rendering only)
         */
        float getRightMargin()
        void setRightMargin(float)

        /*
         * Top page margin (for HTML rendering only)
         */
        float getTopMargin()
        void setTopMargin(float)

        /*
         * Bottom page margin (for HTML rendering only)
         */
        float getBottomMargin()
        void setBottomMargin(float)
    }

Next classes were renamed and from them were extracted interfaces

This changes were made to implement possibility to use custom serialization functionality with caching. More details you can find in Using Custom model classes for caching

It is better to use CacheableFactory.getInstance().newCadViewInfo(...), CacheableFactory.getInstance().newWord(...) and so on to create new instances of classes above. But if you are not going to use custom serialization, you can still use new CadViewInfoImpl(...), new WordImpl(...), …

Behavior changes

  • Starting from 21.2 the CAD drawings are converted to SVG instead of PNG for better quality. Please refer to How to convert CAD to HTML article for more details.

  • In this version we’ve improved viewing of archives and text files - now it could be rendered to multiple and single pages (by default they are rendered to multiple pages). See How to convert archive files and How to convert and view TXT files for more details.

  • In this version we’ve improved viewing of Personal Storage OST/PST files and as a result, the behavior changed.
    Now when viewing personal storage OST /PST files the Inbox folder is selected and displayed by default as it shown on the screenshot below.