Page Break Preview in Python

Aspose.Cells - Hello World

To set worksheet to page break preview using Aspose.Cells Java for Python, simply invoke PageBreakPreview module.

Python Code

 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." 

Download Running Code

Download Page Break Preview (Aspose.Cells) from any of the below mentioned social coding sites: