GroupDocsGists
10/19/2017 - 11:20 AM

renderExcelAsImageWithHiddenSheets.java

// 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 to show grid lines
	ImageOptions options = new ImageOptions();
	options.getCellsOptions().setShowGridLines(true);
	 
	List<PageImage> pages = imageHandler.getPages(guid, options);
	 
	for (PageImage page : pages)
	{
	    System.out.printf("Page number: " + page.getPageNumber());
	 
	    // Page image stream
	    final InputStream imageContent = page.getStream();
	}
} catch (Exception exp) {
	System.out.println("Exception: " + exp.getMessage());
	exp.printStackTrace();
}