While this is java code, it should be easily ported to C#.

http://itextpdf.sourceforge.net/howtosign.html