Agregar adjuntos
using IronPdf;
using System.IO;

// Instantiate the Renderer and create PdfDocument from HTML
var renderer = new ChromePdfRenderer();
var myPdf = renderer.RenderHtmlFileAsPdf("my-content.html");

// Load your own attachment
byte[] attachment = File.ReadAllBytes("path/to/attachment");

// Here we can add an attachment with a name and a byte[]
PdfAttachment exampleAttachment = myPdf.Attachments.AddAttachment("exampleAttachment", attachment);

// And here is an example of removing an attachment
myPdf.Attachments.RemoveAttachment(exampleAttachment);

myPdf.SaveAs("my-content.pdf");
Imports IronPdf
Imports System.IO

' Instantiate the Renderer and create PdfDocument from HTML
Dim renderer As New ChromePdfRenderer()
Dim myPdf = renderer.RenderHtmlFileAsPdf("my-content.html")

' Load your own attachment
Dim attachment As Byte() = File.ReadAllBytes("path/to/attachment")

' Here we can add an attachment with a name and a byte()
Dim exampleAttachment As PdfAttachment = myPdf.Attachments.AddAttachment("exampleAttachment", attachment)

' And here is an example of removing an attachment
myPdf.Attachments.RemoveAttachment(exampleAttachment)

myPdf.SaveAs("my-content.pdf")
NuGet Download
PM > Install-Package IronPdf
Agregar adjuntos

Agregar adjuntos

IronPDF admite la adición y eliminación de adjuntos en sus documentos PDF.

Para más información, puedes explorar la Documentación de IronPDF donde guías detalladas y recursos están disponibles. Además, aprende sobre más características y capacidades en el Sitio Web de Iron Software.

En el contexto de la facturación electrónica española, adjuntar archivos a un PDF es una práctica habitual: el estándar Facturae permite incrustar el XML de la factura dentro del propio PDF, facilitando el envío conjunto a la AEAT o a FACe. Asimismo, es común adjuntar el certificado digital emitido por la FNMT para acreditar la firma PAdES conforme al reglamento eIDAS, o incluir documentación de soporte exigida por el SII en las declaraciones de IVA.

Aprenda a añadir/eliminar archivos adjuntos en PDF con IronPDF.
Ver en GitHub

¿Listo para empezar?

Nuget Downloads 21,253,952Versión:2026.10recién publicada