تقديم القطاعة
Contents
[
Hide
]
تقديم القطاعة
Aspose.Cells for Python via Java يدعم تجسيد شكل التقطيع. يقوم مقتطف الشفرة التالي بتحميل ملفنموذج لملف Excelالذي يحتوي على قطاعة. يقوم بتحويل ورقة العمل إلى صورة عن طريق تعيين منطقة الطباعة التي تغطي أداة التقطيع فقط. الصورة المتدفقة هيصورة الإخراجهذا يظهر القطاعة المقدمة. كما ترى ، تم تقديم أداة التقطيع بشكل صحيح وهي تبدو كما هي في نموذج ملف Excel.
عينة من الرموز
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() |