// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java
try {
// Setup GroupDocs.Viewer config
ViewerConfig config = Utilities.getConfiguration();
// Create image handler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
String guid = fileName;
// Set image options NOT to include ANY transformations
ImageOptions noTransformationsOptions = new ImageOptions();
// This is set by default
noTransformationsOptions.setTransformations(Transformation.None);
// Get image representation of all document pages, without
// transformations
List<PageImage> pagesWithoutTransformations = imageHandler.getPages(guid, noTransformationsOptions);
// Get image representation of all document pages, without
// transformations
List<PageImage> pagesWithoutTransformations2 = imageHandler.getPages(guid);
for (PageImage page : pagesWithoutTransformations) {
Utilities.saveAsImage(page.getPageNumber() + "_" + fileName, "png", page.getStream());
}
} catch (Exception exp) {
System.out.println("Exception: " + exp.getMessage());
exp.printStackTrace();
}