IRONSOFTWAREHOME
Ajouter des pièces jointes
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
Install-Package IronPdf
Ajouter des pièces jointes

Ajouter des pièces jointes

Voir sur GitHub

Prêt à commencer ?

Nuget Downloads 20,667,543Version :2026.7vient de sortir

Key in blue circle

Obtenez votre clé d'essai de 30 jours instantanément.

Aucune restriction. 100 % débloqué. Pas de carte bancaire.

bullet_checkedAucune carte de crédit ou création de compte requiseAucune restriction. 100 % débloqué. Pas de carte bancaire.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Réservez votre Démonstration en direct gratuite
Booking Badge

De confiance par des millions d'ingénieurs dans le monde entier

Logos des clients d'Iron Software
Obtenez Votre Consultation sans Engagement
Remplissez le formulaire ci-dessous ou envoyez un email à sales@ironsoftware.com
Vos informations seront toujours gardées confidentielles.
De confiance par des millions d'ingénieurs dans le monde entier
Logos des clients d'Iron Software
Obtenez votre clé d'essai 30 jours gratuitement.
Aucune carte de crédit ou création de compte requise