Java Swing preview of a ODF word document

392 Views Asked by At

Does anyone know a way to embed an non-editable preview (like a print preview) of a odf writer document existing on the hard drive of the app host into a Java Swing GUI interface ?

1

There are 1 best solutions below

4
Joop Eggen On

Simple: the format ODF is a zip file with inside a folder Thumbnails with thumbnail.png.

With java.util.zip no problem.

You can even try immediately with an URL "jar:file:///... .odt!/Thumbnails/thumbnail.png". Worked for me. I am afraid such a thumbnail is optional though.