Adding New HTML Content

C# + VB.Net: Adding New HTML Content Adding New HTML Content
//PDFs can be edited or amended by stamping new HTML content into the foreground or background.
using IronPdf;


IronPdf.HtmlToPdf Renderer = new IronPdf.HtmlToPdf();
var pdf =  Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf");

var BackgroundStamp = new HtmlStamp() { Html = "<img src='logo.jpg' />", Width = 50, Height = 25, Opactity = 50, Bottom = 5,  ZIndex = HtmlStamp.StampLayer.BehindExistingPDFContent, HtmlBaseUrl = new Server.MapPath("~/assets/") };
pdf.StampHTML(BackgroundStamp);

var ForegroundStamp = new HtmlStamp() { Html = "<h2 style='color:red'>copyright 2018 ironpdf.com", Width = 50, Height = 50, Opactity = 50,  Rotation = -45,  ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent };
pdf.StampHTML(ForegroundStamp);

pdf.SaveAs(@"C:\Path\To\Stamped.pdf");
'PDFs can be edited or amended by stamping new HTML content into the foreground or background.
Imports IronPdf


Private Renderer As New IronPdf.HtmlToPdf()
Private pdf = Renderer.RenderUrlAsPdf("https://www.nuget.org/packages/IronPdf")

Private BackgroundStamp = New HtmlStamp() With {
	.Html = "<img src='logo.jpg' />",
	.Width = 50,
	.Height = 25,
	.Opactity = 50,
	.Bottom = 5,
	.ZIndex = HtmlStamp.StampLayer.BehindExistingPDFContent,
	.HtmlBaseUrl = New Server.MapPath("~/assets/")
}
pdf.StampHTML(BackgroundStamp)

Dim ForegroundStamp = New HtmlStamp() With {
	.Html = "<h2 style='color:red'>copyright 2018 ironpdf.com",
	.Width = 50,
	.Height = 50,
	.Opactity = 50,
	.Rotation = -45,
	.ZIndex = HtmlStamp.StampLayer.OnTopOfExistingPDFContent
}
pdf.StampHTML(ForegroundStamp)

pdf.SaveAs("C:\Path\To\Stamped.pdf")

Developers may edit any PDF document by adding new content to any page (or pages) using the StampHTML method.