Hi,
I want to create a combined pdf of multiple single pdf files. After merging these single pdf files I want to add some text at the top of first pdf page like a heading.
How can I do this?
This is how I merge the files:
Code:
Console.WriteLine("Merging started.....");
PdfDocument outputPDFDocument = new PdfDocument();
foreach (string pdfFile in pdfFiles)
{
PdfDocument inputPDFDocument = PdfReader.Open(pdfFile, PdfDocumentOpenMode.Import);
outputPDFDocument.Version = inputPDFDocument.Version;
foreach (PdfPage page in inputPDFDocument.Pages)
{
outputPDFDocument.AddPage(page);
}
}
outputPDFDocument.Save(outputFilePath);
Console.WriteLine("Merging Completed");