Backgrounds & Foregrounds

C# + VB.Net: Backgrounds & Foregrounds Backgrounds & Foregrounds
using IronPdf;

// With IronPDF, we can easily merge 2 PDF files using one as a backgorund or foreground
IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();
var pdf =  Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");
pdf.AddBackgroundPdf(@"MyBackground.pdf");
pdf.AddForegroundOverlayPdfToPage (0, @"MyForeground.pdf", 0);
pdf.SaveAs(@"C:\Path\To\Complete.pdf");
Imports IronPdf

' With IronPDF, we can easily merge 2 PDF files using one as a backgorund or foreground
Private Renderer As New IronPdf.HtmlToPdf()
Private pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")
pdf.AddBackgroundPdf("MyBackground.pdf")
pdf.AddForegroundOverlayPdfToPage(0, "MyForeground.pdf", 0)
pdf.SaveAs("C:\Path\To\Complete.pdf")

An existing or rendered PDF may be used as the Background or Foreground for another PDF document. This is particularly useful for design consistency and templating.