Lagoda Denis
Lagoda Denis

Reputation: 235

Merging PDFs in one file and add page numbers with PDFsharp/MigraDoc

Searching examples could not find a way to add page numbering using MigraDoc to existing PDFs.
So I have:

PdfDocument outPdf = new PdfDocument()
var pdfFile = PdfReader.Open(new MemoryStream(pdfData), PdfDocumentOpenMode.Import))
CopyPages(pdfFile, outPdf)

How to add here a Section, Paragraph, Footer/Header?

Upvotes: 0

Views: 2379

Answers (1)

The code you are showing uses PDFsharp, not MigraDoc.

MigraDoc cannot alter PDF documents. It can create PDF documents - with headers, footers, page numbers.

PDFsharp can alter PDF pages.
See this answer for a code sample:
https://stackoverflow.com/a/34998271/1015447

Upvotes: 1

Related Questions