跳至頁尾內容

簽署與保護 PDF 檔案

只需幾行程式碼,即可透過現代加密技術、權限設定及數位簽章,確保並保證 PDF 檔案的真實性。

Icon Main related to 簽署與保護 PDF 檔案
確保文件真實性

1

數位簽章

為您的 PDF 文件進行數位簽章,以驗證其真實性並提供作者身分或核准證明。此功能對於法律或官方文件至關重要。

了解如何:在 PDF 文件上簽名
using IronPdf;
using IronPdf.Signing;
// Cryptographically sign an existing PDF in 1 line of code!
new IronPdf.Signing.PdfSignature("Iron.p12", "123456").SignPdfFile("any.pdf");
C#
2

編輯與簽署 修訂歷史紀錄

維護並編輯 PDF 文件的修訂歷史紀錄。追蹤歷時性的變更、核准與簽署,以實現更完善的文件管理。

了解如何:編輯與修訂 PDF 檔案
using IronPdf;
using IronPdf.Rendering;
// Import PDF and enable TrackChanges
PdfDocument pdf = PdfDocument.FromFile("annual_census.pdf", TrackChanges: ChangeTrackingModes.EnableChangeTracking);
// ... Various edits ...
pdf.SignWithFile("/assets/IronSignature.p12", "password", null, IronPdf.Signing.SignaturePermissions.AdditionalSignaturesAndFormFillingAllowed);
PdfDocument pdfWithRevision = pdf.SaveAsRevision();
pdfWithRevision.SaveAs("annual_census_2.pdf");
C#
3

編輯 PDF 元資料

編輯 PDF 檔案的元資料(例如作者、標題和主題),以改善文件組織與可搜尋性。

了解如何:編輯元資料
using IronPdf;
using System;

ChromePdfRenderer renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Metadata</h1>");
// Access the MetaData class and set the pre-defined metadata properties.
pdf.MetaData.Author = "Iron Software";
pdf.MetaData.CreationDate = DateTime.Today;
pdf.MetaData.Creator = "IronPDF";
pdf.SaveAs("pdf-with-metadata.pdf");
C#

Icon Main related to 簽署與保護 PDF 檔案
透過無縫的 PDF 表單管理功能提升效率

1

建立 PDF 表單

建立具備可填寫欄位、核取方塊、單選鈕等功能的互動式 PDF 表單。非常適合用於蒐集資訊或建立問卷調查。

了解如何:建立 PDF 表單
using IronPdf;

// Input and Text Area forms HTML
string FormHtml = @"
<html>
    <body>
        <h2>Editable PDF Form</h2>
        <form>
            First name: <br> <input type='text' name='firstname' value=''> <br>
            Last name: <br> <input type='text' name='lastname' value=''> <br>
            Address: <br> <textarea name='address' rows='4' cols='50'></textarea>
        </form>
    </body>
</html>
";

// Instantiate Renderer
ChromePdfRenderer Renderer = new ChromePdfRenderer();
Renderer.RenderingOptions.CreatePdfFormsFromHtml = true;
Renderer.RenderHtmlAsPdf(FormHtml).SaveAs("textAreaAndInputForm.pdf");
C#
2

填寫與編輯現有表單

輕鬆填寫及編輯現有的 PDF 表單。修改表單欄位、更新內容並儲存變更,實現無縫的文件管理。

了解如何:填寫與編輯表單
using IronPdf;

PdfDocument pdf = PdfDocument.FromFile("textAreaAndInputForm.pdf");

// Set text input form values
pdf.Form.FindFormField("firstname").Value = "John";
pdf.Form.FindFormField("lastname").Value = "Smith";

// Set text area form values
pdf.Form.FindFormField("address").Value = "Iron Software LLC\r\n205 N. Michigan Ave.";

pdf.SaveAs("textAreaAndInputFormEdited.pdf");
C#
3

將表單欄位扁平化

將表單欄位轉換為固定格式,以鎖定已輸入的資料並防止進一步編輯,確保表單內容的完整性。

了解如何:將表單欄位扁平化
using IronPdf;

// Select the desired PDF File
PdfDocument pdf = PdfDocument.FromFile("textAreaAndInputFormEdited.pdf");

// Flatten the pdf
pdf.Flatten();

// Save as a new file
pdf.SaveAs("after_flatten.pdf");
C#

Icon Main related to 簽署與保護 PDF 檔案
確保您的文件安全

1

清理 PDF 檔案

透過移除隱藏的元資料、敏感內容及註解來淨化您的 PDF 檔案,以保護文件的機密性與安全性。

了解如何:清理 PDF 檔案
using IronPdf;

// Import PDF document
PdfDocument pdf = PdfDocument.FromFile("sample.pdf");

// Sanitize with Bitmap
PdfDocument sanitizeWithBitmap = Cleaner.SanitizeWithBitmap(pdf);

// Sanitize with SVG
PdfDocument sanitizeWithSvg = Cleaner.SanitizeWithSvg(pdf);

// Export PDFs
sanitizeWithBitmap.SaveAs("sanitizeWithBitmap.pdf");
sanitizeWithSvg.SaveAs("sanitizeWithSvg.pdf");
C#
2

設定密碼與權限

為您的 PDF 設定密碼與權限,以控制存取權限、防止未經授權的編輯,並保護敏感資訊。

了解如何:設定 PDF 權限
using IronPdf;

ChromePdfRenderer renderer = new ChromePdfRenderer();

PdfDocument pdf = renderer.RenderHtmlAsPdf("<h1>Secret Information:</h1> Hello World");

// Password to edit the pdf
pdf.SecuritySettings.OwnerPassword = "123password";

// Password to open the pdf
pdf.SecuritySettings.UserPassword = "password123";
pdf.SaveAs("protected.pdf");
C#
準備開始了嗎?
Nuget 下載 19,014,616 | 版本: 2026.5 just released
Still Scrolling Icon

還在往下捲動嗎?

想要快速確認成果嗎? PM > Install-Package IronPdf
執行範例 觀看您的 HTML 轉為 PDF。

鋼鐵支援團隊

我們每週 5 天,每天 24 小時在線上。
聊天
電子郵件
打電話給我