try {
// Destination folder
File destFile = new File(demoCore.getTestRootPath() + "export");
// Open the package
OpenXMLDocument docx = OpenXMLDocument.open(demoCore.getTestRootPath() + "sample.docx",
PackageAccess.READ);
// Extract available thumbnails
docx.extractParts(docx.getThumbnails(), destFile);
System.out.println("Thumbnail(s) successfully extracted !");
} catch (OpenXML4JException e) {
e.printStackTrace();
}