Excel を SVG に変換する
Contents
[
Hide
]
Excel を SVG に変換する
SVG(スケーラブル ベクター グラフィックス)は、2次元ベクターグラフィックススペックであり、XML 標準に基づいています。1999 年以来、World Wide Web Consortium (W3C) によって開発されているオープンスタンダードです。
Aspose.Cells for Python via Java では、Excel ファイルを SVG 画像に変換する機能をサポートしています。そのために、API は SheetRender、ImageOrPrintOptions、および WorkbookRender クラスを提供しています。
以下のコードスニペットは、Excel ワークシートを SVG 画像に変換する方法を示しています。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source_directory = "Examples/SampleFiles/SourceDirectory/" | |
output_directory = "Examples/SampleFiles/OutputDirectory/" | |
workbook = Workbook(source_directory + "Book1.xlsx") | |
imgOptions = ImageOrPrintOptions() | |
imgOptions.setSaveFormat(SaveFormat.SVG) | |
sheetCount = workbook.getWorksheets().getCount() | |
for i in range(0, sheetCount): | |
sheet = workbook.getWorksheets().get(i) | |
sr = SheetRender(sheet, imgOptions) | |
for j in range(0, sr.getPageCount()): | |
sr.toImage(j, output_directory + sheet.getName() + "%s" % j + "_out.svg") |