更新时间:2023-02-17 16:41:16
安装Spire.PDF for .NET;然后使用下面的示例C#代码加密任何PDF文件:
Install Spire.PDF for .NET; then use the below sample C# code to encrypt any PDF files:
static void EncryptPDF()
{
//Create a pdf document.
PdfDocument doc = new PdfDocument();
// Create one page
PdfPageBase page = doc.Pages.Add();
//Draw the page
DrawPage(page);
//encrypt
doc.Security.KeySize = PdfEncryptionKeySize.Key128Bit;
doc.Security.OwnerPassword = "e-iceblue";
doc.Security.UserPassword = "test";
doc.Security.Permissions = PdfPermissionsFlags.Print | PdfPermissionsFlags.FillFields;
doc.SaveToFile("Encryption.pdf");
doc.Close();
//Launching the Pdf file.
System.Diagnostics.Process.Start("Encryption.pdf");
}
< b>从PHP网站下载的PDF书籍
这些书籍通过加密下载或密码
i希望开发c#app成为唯一可以打开这些书的程序
和其他PDF工具不能这样做
怎么样?< ; / b>
<b>PDFs books downloaded from PHP site
these books downloaded with encryption or password
i want to develop c# app to be the only program can open these books
and other PDF tools cannot do this
how?</b>
我也在找解密根本就没有大多数都是收费的
我找到了
我也在找解密 根本就没有 大多数都是收费的
I AM FIND