# Control Pagination

This topic describes the steps involved in the custom pagination process in DsExcel.

## Content





DsExcel Java enables users to manage pagination while exporting to a PDF file.

The pagination settings are used to control how the data lying in the worksheets breaks across the pages in the PDF file. The [PrintManager](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/PrintManager.html) class contains the methods that help users in handling custom pagination requirements and preferences.

The custom pagination process works in four basic steps as described below.

*   Step 1 - Create an instance of the [PrintManager](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/PrintManager.html) class
*   Step 2 - Get the default pagination information of the workbook using the [paginate()](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/PrintManager.html#paginate) method.
*   Step 3 - Adjust pagination using different methods of the PrintManager class.
*   Step 4 - Save the PDF file by using either the [savePageInfosToPDF()](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/PrintManager.html#savePageInfosToPDF) method or the [saveWorkbooksToPDF()](/document-solutions/java-excel-api/api/online/com/grapecity/documents/excel/PrintManager.html#saveWorkbooksToPDF) method.

While configuring the pagination options for a workbook containing multiple worksheets, users have complete control over the flow of content (both textual and graphic) across the pages in the PDF file. Further, users can customize the PDF file by adjusting the automatic page breaks while adding or deleting the pages, and modifying the print information on each page of the PDF file. Also, users can keep some rows together in a page; save the content from more than one worksheet to a single PDF; display custom cell ranges inside the exported PDF file; configure custom page settings (like page number, page count, page content, row headers, column headers, title columns, tail columns, page margins, page header, page footer, paper width, paper height etc.); save different header information on different pages; save the last page of the PDF file without any headers, export custom page information and export only some specific pages (or worksheets) in the PDF file.

For more information on handling pagination while working with spreadsheets, refer to the following topics:

*   [Render Excel Range Inside PDF](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/RenderExcelRangeInsidePDF)
*   [Export Multiple Sheets To One Page](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/ExportMultipleSheetsToOnePage)
*   [Keep Rows Together Over Page Breaks](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/KeepRowsTogetherOverPageBreaks)
*   [Delete Blank Pages From Middle](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/DeleteBlankPagesFromMiddle)
*   [Export Different Headers On Different Pages](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/ExportDifferentHeadersonDifferentPages)
*   [Export Last Page Without Headers](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/ExportLastPageWithoutHeaders)
*   [Export Custom Page Information](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/ExportCustomPageInformation)
*   [Export Specific Pages to PDF](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/ExportSpecificPagestoPDF)
*   [Save Multiple Workbooks to Single PDF](/document-solutions/java-excel-api/docs/online/ManageFileOperations/ExporttoaPDFFile/ControlPagination/SaveMultipleWorkbookstoSinglePDF)

<br />