在 IronPDF 中應用數位簽章
數位簽章是一種加密方法,可透過 IronPDF 函式庫添加至現有的 PDF 文件中。 這包括新增單一及多重簽名,並搭配遞增節省簽名。
支援的數位簽章憑證
IronPDF 支援 Windows 系統的 .pfx 格式數位簽章憑證,以及 macOS 系統的 .p12 格式數位簽章憑證。 這些內容符合 X509Certificate2 標準。 您可以透過檢查檔案副檔名來驗證現有數位簽章憑證的格式。
若您沒有符合要求的憑證,請參閱此文件以建立新的 X509Certificate2 標準憑證。 生成的憑證隨後可透過 IronPDF 套用至 PDF 文件中。
X509KeyStorageFlags.Exportable。 部分憑證預設將 KeyStorageFlags 設定為"可匯出"。 若嘗試使用不同的 KeyStorageFlags,將會引發例外狀況。)}]附圖簽名
可在 PDF 文件中加入圖片,以視覺方式標示該文件已進行數位簽章。 可透過 IronPDF 並使用以下程式碼片段來實現:
// Create a PdfSignature object by specifying the certificate file (.pfx) and its password
var sig = new PdfSignature("IronSoftware.pfx", "123456");
// Set the signature image which includes the image path, page number, and its position in the document
sig.SignatureImage = new PdfSignatureImage("IronSoftware.png", 0, new Rectangle(0, 600, 100, 100));
// Create a PdfSignature object by specifying the certificate file (.pfx) and its password
var sig = new PdfSignature("IronSoftware.pfx", "123456");
// Set the signature image which includes the image path, page number, and its position in the document
sig.SignatureImage = new PdfSignatureImage("IronSoftware.png", 0, new Rectangle(0, 600, 100, 100));
' Create a PdfSignature object by specifying the certificate file (.pfx) and its password
Dim sig = New PdfSignature("IronSoftware.pfx", "123456")
' Set the signature image which includes the image path, page number, and its position in the document
sig.SignatureImage = New PdfSignatureImage("IronSoftware.png", 0, New Rectangle(0, 600, 100, 100))
請確保專案中的圖片檔案屬性已設定為 "CopyToOutputDirectory=always",以便在套用簽名後,系統能於 PDF 文件中找到並渲染該圖片。
若要進一步了解如何透過 IronPDF 套用數位簽章,請參閱《對 PDF 文件進行數位簽章》。
如需工程支援,請參閱《如何提交 IronPDF 工程支援請求》。

