from ironpdf import *
# Instantiate the Renderer and create PdfDocument from HTML
renderer = ChromePdfRenderer()
my_pdf = renderer.RenderHtmlFileAsPdf("my-content.html")
# Open PDF document to be attached
pdf = PdfDocument.FromFile("new_sample.pdf")
# Here we can add an attachment with a name and a byte[]
attachment1 = my_pdf.Attachments.AddAttachment("attachment_1", pdf.BinaryData)
# And here is an example of removing an attachment
my_pdf.Attachments.RemoveAttachment(attachment1)
my_pdf.SaveAs("my-content.pdf")
#Instantiate the Renderer and create PdfDocument from HTML
#Open PDF document to be attached
#Here we can add an attachment with a name and a byte[]
#And here is an example of removing an attachment
'INSTANT VB TODO TASK: The following line uses invalid syntax:
'from ironpdf import * renderer = ChromePdfRenderer() my_pdf = renderer.RenderHtmlFileAsPdf("my-content.html") pdf = PdfDocument.FromFile("new_sample.pdf") attachment1 = my_pdf.Attachments.AddAttachment("attachment_1", pdf.BinaryData) my_pdf.Attachments.RemoveAttachment(attachment1) my_pdf.SaveAs("my-content.pdf")