تحديد عدد الصفحات المولدة تحويل Excel إلى PDF

تحديد الحد الأقصى لعدد الصفحات المولدة

المثال التالي يظهر كيفية عرض مجموعة من الصفحات (3 و 4) في ملف Microsoft Excel إلى صيغة PDF.

from aspose.cells import PdfSaveOptions, Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Open an Excel file
wb = Workbook(dataDir + "TestBook.xlsx")
# Instantiate the PdfSaveOption
options = PdfSaveOptions()
# Print only Page 3 and Page 4 in the output PDF
# Starting page index (0-based index)
options.page_index = 3
# Number of pages to be printed
options.page_count = 2
# Save the PDF file
wb.save(dataDir + "outPDF1.out.pdf", options)