Spire.Presentation for .NET 是专业的 PowerPoint组件,开发者可以在 .NET 平台上对 PPT文档进行生成、修改、转换和打印等操作,而无需安装 Microsoft PowerPoint。
这么优秀的国产工具怎能错过呢!想要获取更多福利的朋友咨询在线客服哦~
添加数字签名
C#
using Spire.Presentation;using System;using System.Security.Cryptography.X509Certificates;namespace AddDigitalSignature{ class Program { static void Main(string[] args) { //Create a Presentation instance Presentation ppt = new Presentation(); //Load a PowerPoint document ppt.LoadFromFile("Input.pptx"); //Add digital signature X509Certificate2 x509 = new X509Certificate2("gary.pfx", "e-iceblue"); ppt.AddDigitalSignature(x509, "e-iceblue", DateTime.Now); //Save the result document ppt.SaveToFile("AddDigitalSignature.pptx", FileFormat.Pptx2013); } }}
VB.NET
Imports Spire.PresentationImports SystemImports System.Security.Cryptography.X509CertificatesNamespace AddDigitalSignature Class Program Private Shared Sub Main(ByVal args As String()) Dim ppt As Presentation = New Presentation() ppt.LoadFromFile("Input.pptx") Dim x509 As X509Certificate2 = New X509Certificate2("gary.pfx", "e-iceblue") ppt.AddDigitalSignature(x509, "e-iceblue", DateTime.Now) ppt.SaveToFile("AddDigitalSignature.pptx", FileFormat.Pptx2013) End Sub End ClassEnd Namespace
效果图:

删除数字签名
C#
using Spire.Presentation;using System;using System.Security.Cryptography.X509Certificates;namespace RemoveDigitalSignature{ class Program { static void Main(string[] args) { //Create a Presentation instance Presentation ppt = new Presentation(); //Load a PowerPoint document ppt.LoadFromFile("AddDigitalSignature.pptx"); //Detect if the document is digitally signed if (ppt.IsDigitallySigned == true) { //Remove the digital signature ppt.RemoveAllDigitalSignatures(); } //Save the result document ppt.SaveToFile("RemoveDigitalSignature.pptx", FileFormat.Pptx2013); } }}
VB.NET
Imports Spire.PresentationImports SystemImports System.Security.Cryptography.X509CertificatesNamespace RemoveDigitalSignature Class Program Private Shared Sub Main(ByVal args As String()) Dim ppt As Presentation = New Presentation() ppt.LoadFromFile("AddDigitalSignature.pptx") If ppt.IsDigitallySigned = True Then ppt.RemoveAllDigitalSignatures() End If ppt.SaveToFile("RemoveDigitalSignature.pptx", FileFormat.Pptx2013) End Sub End ClassEnd Namespace
效果图:

还想要更多吗可以点击阅读【2020 · E-iceblue最新资源整合】,查找需要的教程资源。是E-iceblue官方友好合作伙伴,如果您对spire.Presentation感兴趣,可以联系在线客服了解具体授权价格和使用机制。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!