Hi everyone!
I'd like to thank first and introduce myself. I'll help in everything i can, but now i need some help, i'm newbie with this tool.
I'm trying to use a pdf (single page) as a watermark for another pdf (many pages).
I can achieve this but the issue is the way it draws the image. I need the watermark to be underneath de main document pages, not above, as this method is doing :
Code:
using (PdfSharp.Pdf.PdfDocument originalDocument = PdfReader.Open(@"C:\Users\...\Merged.pdf", PdfDocumentOpenMode.Import))
using (PdfSharp.Pdf.PdfDocument outputPdf = new PdfSharp.Pdf.PdfDocument())
{
foreach (PdfSharp.Pdf.PdfPage page in originalDocument.Pages)
{
outputPdf.AddPage(page );
}
var background = XImage.FromFile(@"C:\Users\....\background.pdf");
foreach (PdfSharp.Pdf.PdfPage page in outputPdf.Pages)
{
XGraphics graphics = XGraphics.FromPdfPage(page);
graphics.DrawImage(background, 1, 1);
}
outputPdf.Save(@"C:\Users\.....\Final.pdf");
}
Any one can help?
thak you so much.
best regards.