PDF 文档电子签名解决方案

使用免费的跨平台应用程序和API对PDF文档进行数字签名。

如何将数字签名添加到 PDF 文件

为了添加登录 PDF 文件,我们将使用 Aspose.PDF API,这是一款功能丰富、功能强大且易于使用的文档操作 API。打开 NuGet 软件包管理器,搜索 Aspose.PDF 然后安装。您也可以在软件包管理器控制台中使用以下命令。使用签名对PDF文档进行签名时,基本上 “按原样” 确认其内容。因此,之后所做的任何其他更改都会使签名失效,因此,您将知道文档是否被更改。

您可以使用以下类和方法进行 PDF 签名

  1. Class docmdpSignature。 1.枚举 docmdpAccessPermissions。 1.PDFFileSignature 类中的财产 isCertified

使用数字签名为 PDF 签名。

<% signature0.code-block.subtitle %>

   var esign_doc = new Document("My File.pdf");
    var page = esign_doc.PdfDocument.Pages[1];
    // Create text stamp
    TextStamp textStamp = new TextStamp(getFormattedText("digital signature text"));
    // Set whether stamp is background
    // textStamp.Background = true;
    textStamp.HorizontalAlignment = HorizontalAlignment.Right;
    textStamp.VerticalAlignment = VerticalAlignment.Bottom;
    textStamp.TextAlignment = HorizontalAlignment.Center;
    textStamp.TextState.Font = FontRepository.FindFont("Arial");
    textStamp.TextState.FontSize = 50;
    textStamp.Width = page.PageInfo.Width / 3;
    textStamp.TextState.ForegroundColor = Color.FromRgb(System.Drawing.Color.Aqua);
    page.AddStamp(textStamp);

    esign_doc.Save("esignedFile.pdf", SaveFormat.Pdf);