Skip to content

Java thumbnail generator for Office,PDF,HTML,Text,MP3,MPEG and Image documents

Notifications You must be signed in to change notification settings

CodeBlo/JThumbnail

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 

Repository files navigation

JThumbnail

Codacy Badge

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

  • Project is under development!

How to use

try {
   AppSettings.init(args);   
   Thumbnailer.start();
   File in = new File("/inputFile.docx");
   if(in.exists()) {
      ThumbnailCandidate candidate = new ThumbnailCandidate(in,"unique_code");

      Thumbnailer.createThumbnail(candidate, new ThumbnailListener() {
         @Override
         public void onThumbnailReady(String hash, File thumbnail) {
            System.out.println("FILE created in : " + thumbnail.getAbsolutePath());
         }

         @Override
         public void onThumbnailFailed(String hash, String message, int code) {

         }
      });
   }
   } catch (IOException | ThumbnailerException e) {
         e.printStackTrace();
   }

Configuration Args

  • openoffice_port tcp port for open office.
  • openoffice_dir open office home dir.
  • temp_dir temp directory for saving thumb files.
  • thumb_height thumbnail height size in px.
  • thumb_width thumbnail width size in px.

Requirements

  • Java JRE 1.8
  • (optional) OpenOffice 4 or LibreOffice

Supported File Formats

  • Office files (doc, docx, xls, xlsx, ppt, pptx)
  • OpenOffice files (all of them)
  • Text files (txt, pdf, rtf, html)
  • Image files (jpg, png, bmp, gif)
  • AutoCad files (dwg)
  • MP3 files (user album-art as thumbnail)
  • MPEG files (generate gif file)

How to Use

Maven

Step 1. Add the JitPack repository to your build file

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Step 2. Add the dependency

	<dependency>
	    <groupId>com.github.makbn</groupId>
	    <artifactId>JThumbnail</artifactId>
	    <version>master-SNAPSHOT</version>
	</dependency>

Gradle

Step 1. Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

**Step 2. Add the dependency

	dependencies {
	        implementation 'com.github.makbn:JThumbnail:master-SNAPSHOT'
	}

TODO

  • Update all dependenciesfrom jar to maven
  • update project old and deprecated depencencies
  • Change the structure of project
  • Add new Configuration method to confige OpenOffice dir and port
  • Add Async multi-thread support

Original project

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

About

Java thumbnail generator for Office,PDF,HTML,Text,MP3,MPEG and Image documents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%