from ironpdf import * # Instanciar el Renderizador y crear PdfDocument a partir de HTML renderer = ChromePdfRenderer() my_pdf = renderer.RenderHtmlFileAsPdf("my-content.html") # Abrir documento PDF para adjuntar pdf = PdfDocument.FromFile("new_sample.pdf") # Aquí podemos añadir un archivo adjunto con un nombre y un byte[] attachment1 = my_pdf.Attachments.AddAttachment("attachment_1", pdf.BinaryData) # Y he aquí un ejemplo de eliminación de un archivo adjunto my_pdf.Attachments.RemoveAttachment(attachment1) my_pdf.SaveAs("my-content.pdf")