[]
Updates the page number, page count, and page settings of each page.
Call this method after the page collection changes, such as when pages are added, deleted, or moved. It refreshes the supplied PageInfo list so pagination metadata stays consistent before further processing or export.
public void UpdatePageNumberAndPageSettings(IList<PageInfo> pages)
Public Sub UpdatePageNumberAndPageSettings(pages As IList(Of PageInfo))
| Type | Name | Description |
|---|---|---|
| IList<PageInfo> | pages | The page collection to update. Typically this is a list returned by Paginate(IWorksheet) after the collection has been changed. |
worksheet.PageSetup.PrintArea = "B2:N40";
worksheet.Range["B2:N40"].Value = 10;
PrintManager printManager = new PrintManager();
IList<PageInfo> pages = printManager.Paginate(worksheet);
PageInfo page = pages[0];
pages.RemoveAt(0);
pages.Add(page);
printManager.UpdatePageNumberAndPageSettings(pages);
Update the page number, page count and page settings of each page. When the page collection changes (add, delete, move), you need to call this method to update the pages information.
public void UpdatePageNumberAndPageSettings(IList<PageInfo> pages, int firstPageNumber, int pageCount)
Public Sub UpdatePageNumberAndPageSettings(pages As IList(Of PageInfo), firstPageNumber As Integer, pageCount As Integer)
| Type | Name | Description |
|---|---|---|
| IList<PageInfo> | pages | The page collection. |
| int | firstPageNumber | The page number of the first page. |
| int | pageCount | The total number of pages. |