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
Private renderer = New ChromePdfRenderer()
Private myPdf = renderer.RenderHtmlFileAsPdf("my-content.html")
' Load your own attachment
Private attachment() As Byte = File.ReadAllBytes("path/to/attachment")
' Here we can add an attachment with a name and a byte[]
Private 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")
Install-Package IronPdf
Ajouter des pièces jointes
IronPDF permet d'ajouter et de supprimer des pièces jointes à vos documents PDF.
Pour plus d'informations, vous pouvez consulter le siteDocumentation IronPDF des guides détaillés et des ressources sont disponibles. En outre, vous pouvez découvrir d'autres fonctionnalités et capacités sur le site Web deSite web d'Iron Software.
Des millions d'ingénieurs dans le monde entier lui font confiance
Réservez une démo en direct gratuite
Réservez une démonstration personnelle de 30 minutes.
Pas de contrat, pas de détails de carte, pas d'engagements.
Voici ce à quoi vous pouvez vous attendre :
Une démonstration en direct de notre produit et de ses principales fonctionnalités
Obtenez des recommandations de fonctionnalités spécifiques au projet
Toutes vos questions trouvent réponse pour vous assurer de disposer de toutes les informations dont vous avez besoin. (Aucune obligation de votre part.)
CHOISIR L'HEURE
VOS INFORMATIONS
Réservez votre gratuit Démonstration en direct
Fiable par plus de 2 millions d'ingénieurs dans le monde entier