[]
Gets the 1-based page number associated with this event.
This value identifies the page currently being processed in the PagePrinting or PagePrinted event sequence.
public int PageNumber { get; }
Public ReadOnly Property PageNumber As Integer
worksheet.Range["A1:A96"].Value = 1;
int pageNumber = 0;
PdfSaveOptions options = new PdfSaveOptions();
options.PagePrinting += (sender, e) =>
{
pageNumber = e.PageNumber;
};
using MemoryStream stream = new MemoryStream();
workbook.Save(stream, options);