h2appy

http://sourceforge.net/projects/itextsharp/下载iTextSharp的源代码或DLL。

 

利用iTextSharp,从C#、VB等.Net下语言处理PDF文件,不用安装Acrobat,确实方便。


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);
        }
    }
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-05-26
  • 2021-04-05
  • 2022-01-16
  • 2021-11-07
  • 2022-12-23
  • 2021-07-25
  • 2022-12-23
猜你喜欢
  • 2021-08-18
  • 2022-02-14
  • 2022-02-09
  • 2021-12-27
  • 2021-12-20
  • 2021-11-14
相关资源
相似解决方案