İşleme Dilimleyici
Contents
[
Hide
]
İşleme Dilimleyici
Aspose.Cells for Python via Java, dilimleyici şeklinin oluşturulmasını destekler. Aşağıdaki kod parçacığı,örnek excel dosyasıbir dilimleyici içerir. Yalnızca dilimleyiciyi kaplayan yazdırma alanını ayarlayarak çalışma sayfasını bir görüntüye dönüştürür. Akan görüntü iseçıktı görüntüsüişlenen dilimleyiciyi gösterir. Gördüğünüz gibi, dilimleyici düzgün bir şekilde oluşturuldu ve örnek Excel dosyasındakiyle aynı görünüyor.
Basit kod
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
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat, ImageOrPrintOptions, ImageType, SheetRender | |
# Load Source Excel file | |
workbook = Workbook("sampleRenderingSlicer.xlsx") | |
# Access first worksheet | |
worksheet = workbook.getWorksheets().get(0) | |
# Set the print area because we want to render slicer only | |
worksheet.getPageSetup().setPrintArea("B15:E25") | |
# Specify image or print options, set one page per sheet and only area to true | |
imgOpts = ImageOrPrintOptions() | |
imgOpts.setHorizontalResolution(200) | |
imgOpts.setVerticalResolution(200) | |
imgOpts.setImageType(ImageType.PNG) | |
imgOpts.setOnePagePerSheet(True) | |
imgOpts.setOnlyArea(True) | |
# Create sheet render object and render worksheet to image | |
sheetrender = SheetRender(worksheet, imgOpts) | |
sheetrender.toImage(0, "outputRenderingSlicer.png") | |
jpype.shutdownJVM() |