添加附件
IronPDF 支援新增和刪除您的 PDF 文件的附件。
如需更多資訊,您可以瀏覽IronPDF 文件,此處提供詳細的指南和資源。 此外,您可以在Iron Software 網站了解更多功能和能力。
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")
IronPDF 支援新增和刪除您的 PDF 文件的附件。
如需更多資訊,您可以瀏覽IronPDF 文件,此處提供詳細的指南和資源。 此外,您可以在Iron Software 網站了解更多功能和能力。
30天試用密鑰立即獲取。
15天試用金鑰 立即可用。
不需要信用卡
您的試用金鑰應已發送至您的電子郵件。試用表格已
成功提交。
如果沒有收到,請聯絡
support@ironsoftware.com
免費開始
不需要信用卡
在生產環境中測試,無水印。
在任何需要的地方都能運行。
獲得 30 天的全功能產品。
在幾分鐘內上手運行。
試用產品期間完全訪問我們的支援工程團隊
預約30分鐘的個人演示。
無合約,無卡片信息,無承諾。

10 .NET API 產品適用於您的辦公文檔