Conversione del foglio di lavoro in SVG in Python

Aspose.Cells - Conversione del foglio di lavoro in SVG

Per convertire il foglio di lavoro in SVG utilizzando Aspose.Cells for Java in Python, è sufficiente richiamare il foglio di lavoro_a_svg() metodo del modulo Converter.

Python Cod

 saveFormat = self.SaveFormat

workbook = self.Workbook(self.dataDir + "Book1.xls")

# Convert each worksheet into svg format in a single page.

imgOptions = ImageOrPrintOptions()

imgOptions.setSaveFormat(saveFormat.SVG)

imgOptions.setOnePagePerSheet(True)

# Convert each worksheet into svg format

sheetCount = workbook.getWorksheets().getCount()

# for(i=0; i<sheetCount; i++)

for i in range(sheetCount):

sheet = workbook.getWorksheets().get(i)

sr = SheetRender(sheet, imgOptions)

pageCount = sr.getPageCount()

# for (k = 0 k < pageCount k++)

for k in range(pageCount):

# Output the worksheet into Svg image format

sr.toImage(k, self.dataDir + sheet.getName() + ".out.svg")



\# Print message

print "Excel to SVG conversion completed successfully."

Scarica il codice in esecuzione

ScaricamentoConversione del foglio di lavoro in SVG(Aspose.Cells) da uno qualsiasi dei siti di social coding sotto indicati: