GroupDocs.Viewer for Java 17.5.1 Release Notes

Major Features

This release includes one new feature and two bug fixes.

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
VIEWERJAVA-1601Add method to clean up temporary filesNew Feature
VIEWERJAVA-1582NullPointerException when rendering PDF as HTMLBug
VIEWERJAVA-1568Performance degradation during consequent iterations through the same documentsBug

 Public API and Backward Incompatible Changes

How to clean up temporary files

While rendering documents, GroupDocs.Viewer creates temporary files which were removed automatically after each operation. As removing temporary files is time-consuming operation new method **clearTempFiles **was introduced. This method is thread-safe and can be called any time so it won’t affect documents rendering. GroupDocs.Viewer uses default system temporary folder to store temp files, it can be changed by setting temporary directory in process properties e.g. System.setProperty("java.io.tmpdir", "c:/my_temp_files/");

How to clean up 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();