Download the source code or dllof itextsharpfrom http://sourceforge.net/projects/itextsharp.
Using itextsharp to process PDF files in C #, VB, and other. NET languages without installing acrobat is really convenient.
Using system;
Using system. Collections. Generic;
Using system. text;
Using itextsharp.text.pdf;
Using system. IO;
Namespace authentication security
{
Class pdfencry
{
Public static void encry (string comment SRC, string comment DEST, bool strength,
String userpassword, string ownerpassword, int permissions)
{
Pdfreader reader = new pdfreader (javassrc );
Stream OS = (Stream) (new filestream (includest, filemode. Create ));
Pdfencryptor. Encrypt (reader, OS, strength, userpassword, ownerpassword, permissions );
}
}
}
Using system;
Using system. Collections. Generic;
Using system. text;
Using itextsharp.text.pdf;
Using system. IO;
Namespace authentication security
{
Class pdfencry
{
Public static void encry (string comment SRC, string comment DEST, bool strength,
String userpassword, string ownerpassword, int permissions)
{
Pdfreader reader = new pdfreader (javassrc );
Stream OS = (Stream) (new filestream (includest, filemode. Create ));
Pdfencryptor. Encrypt (reader, OS, strength, userpassword, ownerpassword, permissions );
}
}
}