You must Sign In to post a response.
  • Category: ASP.NET

    How to implement digital signature in pdf file using

    Dear all, please guide me how to implement digital signature in pdf file without opening the file using Please guide me step by step
  • #766079
    Try below links..

  • #766098
    You can do it using itextSharp, a free pdf operations library.
    Please find code for implementing digital signatures using iTexstSharp:

  • #766110
    Dotnet does not have a API to interact with PDF files directly, you need to take support of some third party DLL to deal with PDF
    you can use iTextSharp dll, this library will allow you to do this. iTextSharp provides a lot of interesting features to create and manipulate PDF documents, you will also use some function to manipulate PKCS#12 certificates; the only thing you need to know here is that our digital signature will use a private key extracted from a PKCS#12 certificate.
    see below links
    alternatively, you can use
    .NET Digital Signature Library, its used to to digitally sign files in PDF, CAdES or PKCS#7 cryptographic standard (.P7S or .P7M files) using X.509 certificates stored on PFX files or smart cards, USB tokens, HSM's (Hardware Security Modules) stored on Microsoft Certificate Store. see below snippet

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #766119
    There are lot of 3rd party DLL to create PDF files. But you can use "iTextSharp". This is open source. It is very simple to create the PDF

    You can create the PDF by using simple MemoryStream also.

    using (MemoryStream ms = new MemoryStream())
    Document document = new Document(PageSize.A4, 25, 25, 30, 30);
    PdfWriter writer = PdfWriter.GetInstance(document, ms);
    document.Add(new Paragraph("Hello World"));
    Response.ContentType = "pdf/application";
    "attachment;filename=First PDF document.pdf");
    Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);

    By Nathan
    Direction is important than speed

  • #766157
    Here is a step by step guidance for implementing digital signature in a pdf file in C# using a free .NET pdf library for your reference:

  • #766189
    Firstly, thanks for all who have guided me. Hi bharati, I have tried the examples listed in the link: and also able to place the signature in PDF file. But I could not place the signature wherever I want. I will explain my process. I had developed the software in vb6 which generates monthly invoices. Once we generates the invoices, we are converting those invoices into pdf files through software. Now I want to place signature at the end of the invoice. The end of the invoice may come to half of first page in pdf file or half of the second page in pdf file or at the end of the second page in pdf file. It is based on the length of the invoice. You please guide me how to place the signature in pdf at particular point.

  • #766193
    have you tried
    PdfSignature.SignaturePosition = SignaturePosition.TopRight/TopMiddle/BottomRight ?
    Or if you are using rectangle for signature positioning, then pass proper calculated height and width to it.

Sign In to post your comments