JThumbnail

Codacy Badge

JThumbnail is a Java library for creating Thumbnails of common types of file including .doc, .docx, .pdf , .mp4 etc. full list

Project Source: https://github.com/makbn/JThumbnail

How to use


String[] args = new String[]{};

JThumbnailer jThumbnailer = JThumbnailerStarter.init(args);

File in = new File("/inputFile.docx");

ThumbnailCandidate candidate = new ThumbnailCandidate(in,"unique_code");

jThumbnailer.run(candidate, new ThumbnailListener() {
     @Override
     public void onThumbnailReady(String hash, File thumbnail) {
        Files.copy(thumbnail.toPath(), Path.of("my_thumbnail_folder", thumbnail.getName()), StandardCopyOption.REPLACE_EXISTING);
     }

     @Override
     public void onThumbnailFailed(String hash, String message, int code) {
        // handle the situation
     }
});

// close thumbnailer
jThumbnailer.close();

Configuration Args

Configuration Args Description
OPENOFFICE Properties  
jthumbnailer.name Application name, e.g. Java Thumbnail Generator
jthumbnailer.openoffice.port Ports used by OpenOffice for document conversion
jthumbnailer.openoffice.timeout Timeout for OpenOffice document conversion tasks
jthumbnailer.openoffice.max_tasks_per_process Maximum number of conversion tasks allowed per OpenOffice process
jthumbnailer.openoffice.dir Directory path to the OpenOffice installation
jthumbnailer.openoffice.tmp Directory path for temporary files generated and used by OpenOffice
JTHUMBNAILER Properties  
jthumbnailer.thumb_width Width of generated thumbnails
jthumbnailer.thumb_height Height of generated thumbnails
jthumbnailer.async.core_pool_size Core pool size for the asynchronous processing tasks
jthumbnailer.async.max_pool_size Maximum pool size for the asynchronous processing tasks
Spring  
spring.servlet.multipart.max-file-size Maximum allowed file size for multipart file uploads
spring.servlet.multipart.max-request-size Maximum allowed request size for multipart file uploads
server.port Port on which the application will be hosted
Spring Doc  
springdoc.api-docs.path Path for accessing the API documentation in JSON format
springdoc.swagger-ui.path Path for accessing the Swagger UI for interactive API documentation

Requirements

Supported File Formats

Adding Repository

Maven


Step 1. Add the dependency to the pom file:

<dependency>
  <groupId>io.github.makbn</groupId>
  <artifactId>jthumbnail</artifactId>
  <version>2.2.0</version>
</dependency>

Gradle


Step 1. Add the dependency to the build.gradle file:

compile "io.github.makbn:jthumbnail:2.2.0"

TODO

Original project

JThumbnail is based on an old project of the university of Siegen for the benefit of come_IN Computerclubs. and thanks a lot to @benjaminpick