Logo Image We are pleased to announce the release of GroupDocs.Viewer for Java 17.5.1. This is a hotfix release that contains 2 bug fixes and a new feature. The latest version allows you to manually cleanup the temporary files that are created during document rendering. Please continue to read the details about the new feature and the bug fixes.

Cleanup Temporary FilesWhile rendering documents, GroupDocs.Viewer creates temporary files which were removed automatically after each operation. As removing temporary files is a time-consuming operation, therefore, a new method clearTempFiles is introduced. This method is thread-safe and can be called any time so it won’t affect documents’ rendering. GroupDocs.Viewer uses default system’s temporary folder to store temp files and it can be changed by setting temporary directory in process properties e.g. System.setProperty(“java.io.tmpdir”, “c:/my_temp_files/”). The following code sample shows how to cleanup temporary files.

// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
   
// Create image or html handler
ViewerImageHandler handler = new ViewerImageHandler(config);
  
// Cleanup temporary files
handler.clearTempFiles();

Bug FixesFollowing bugs have been fixed in this hotfix release:

  • NullPointerException when rendering PDF as HTML
  • Performance degradation during consequent iterations through the same documents

FeedbackAs always, you are welcome to share your feedback to improve this product. We will be happy to know your thoughts. Just create a forum thread and our dedicated support team will be there to respond.