I am merging a series of Word documents by converting each of them into PDF using PdfSharp.PDF. Each Word document has paging defined in it (for ex: "Page 1 of 2" etc). But when I merge the PDF, I want to overwrite the paging to indicate the page # across all pages present in the merged document (i.e. "Page 1 of 265" etc).
I found a few options online but using other PDF techniques but can this be achieved using PdfSharp.PDF?
Heres the code -
PdfDocument outputDocument = new PdfDocument();
PdfDocument currPdf = PdfReader.Open((string)fileName, PdfDocumentOpenMode.Import);
foreach (PdfPage p in currPdf.Pages)
{
outputDocument.AddPage(p);
}
outputDocument.Save(outputName);