Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To convert a worksheet to an image using Aspose.Cells for Java in Python, simply invoke the Converter module.
Python Code
imageFormat = self.ImageFormat
# Instantiate a workbook with the path to an Excel file
book = self.Workbook(self.dataDir + "Book1.xls")
# Create an object for ImageOptions
imgOptions = self.ImageOrPrintOptions()
# Set the image type
imgOptions.setImageFormat(imageFormat.getPng())
# Get the first worksheet.
sheet = book.getWorksheets().get(0)
# Create a SheetRender object for the target sheet
sr = self.SheetRender(sheet, imgOptions)
for i in range(sr.getPageCount()):
# Generate an image for the worksheet
sr.toImage(i, self.dataDir + "mysheetimg" + ".png")
# Print message
print "Images generated successfully."Download Worksheet To Image (Aspose.Cells) from any of the below‑mentioned social coding sites:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.