AnnotationConfig cfg = Utilities.getConfiguration();
AnnotationImageHandler annotator = new AnnotationImageHandler(cfg);
List<PageImage> images = annotator.getPages(fileName, new ImageOptions());
for (int i = 0; i < images.size(); i++) {
OutputStream fileStream = new FileOutputStream(Utilities.outputPath + File.separator + "image_" + i + ".png");
final PageImage pageImage = images.get(i);
IOUtils.copy(pageImage.getStream(), fileStream);
}