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!
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();
}
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.
- Java JRE 1.8
- (optional) OpenOffice 4 or LibreOffice
- 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)
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>
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'
}
- 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
- Support PNG, JPG output format for thumbnails
JThumbnail is based on an old project of the university of Siegen for the benefit of come_IN Computerclubs. and thanks alot to @benjaminpick