62,046
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Text;
using iTextSharp.text.pdf;
using System.IO;
namespace PDFSecurity
{
class PDFEncry
{
public static void Encry(string pdfSrc, string pdfDest, bool strength,
string userPassword, string ownerPassword, int permissions)
{
PdfReader reader = new PdfReader(pdfSrc);
Stream os = (Stream)(new FileStream(pdfDest, FileMode.Create));
PdfEncryptor.Encrypt(reader, os, strength, userPassword, ownerPassword, permissions);
}
}
}