Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To add page breaks using Aspose.Cells Java for PHP, call the add_page_breaks method of the pagebreaks module. Below is a code example.
PHP Code
$worksheets = $workbook->getWorksheets();
$worksheet = $worksheets->get(0);
$h_page_breaks = $worksheet->getHorizontalPageBreaks();
$h_page_breaks->add("Y30");
$v_page_breaks = $worksheet->getVerticalPageBreaks();
$v_page_breaks->add("Y30");
# Saving the modified Excel file in the default (i.e., Excel 2003) format
$workbook->save($dataDir . "Add Page Breaks.xls");
To clear all page breaks using Aspose.Cells Java for PHP, call the clear_all_page_breaks method of the pagebreaks module. Below is a code example.
PHP Code
$workbook->getWorksheets()->get(0)->getHorizontalPageBreaks()->clear();
$workbook->getWorksheets()->get(0)->getVerticalPageBreaks()->clear();
# Saving the modified Excel file in the default (i.e., Excel 2003) format
$workbook->save($dataDir . "Clear All Page Breaks.xls");
To remove a specific page break using Aspose.Cells Java for PHP, call the remove_page_break method of the pagebreaks module. Below is a code example.
PHP Code
$worksheets = $workbook->getWorksheets();
$worksheet = $worksheets->get(0);
$h_page_breaks = $worksheet->getHorizontalPageBreaks();
$h_page_breaks->removeAt(0);
$v_page_breaks = $worksheet->getVerticalPageBreaks();
$v_page_breaks->removeAt(0);
# Saving the modified Excel file in the default (i.e., Excel 2003) format
$workbook->save($dataDir . "Remove Page Break.xls");
Download Managing Page Breaks (Aspose.Cells) from any of the below‑mentioned social coding sites:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.