Python 中的分页预览

Aspose.Cells - Hello World

将工作表设置为分页预览使用Aspose.Cells Java for Python 只需调用分页预览模块。

Python 代码

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

# Adding a new worksheet to the Workbook object

worksheets = workbook.getWorksheets()

worksheet = worksheets.get(0)

# Displaying the worksheet in page break preview

worksheet.setPageBreakPreview(True)

# Saving the modified Excel file in default format

workbook.save(self.dataDir + "output.xls")

\# Print message

print "Page break preview is enabled for sheet 1, please check the output document." 

下载运行代码

下载**分页预览 (Aspose.Cells)**来自以下任何社交编码网站: