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

    How to implement digital signature in pdf file using asp.net

    Dear all, please guide me how to implement digital signature in pdf file without opening the file using asp.net. Please guide me step by step
  • #766079
    Hi,
    Try below links..
    http://www.signfiles.com/manuals/SignatureLibraryUserManual.pdf

    http://www.signfiles.com/manuals/PDFSignerUserManual.pdf

    http://www.codeproject.com/KB/vb/Digital_Signatures.aspx

    http://www.devx.com/security/Article/17249/0/page/2

    http://www.example-code.com/vbdotnet/digSig1.asp

    http://www.abanet.org/scitech/ec/isc/dsg-tutorial.html

    http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=sdkHelp&file=signaturesSigning.90.4.html

    http://www.c-sharpcorner.com/UploadFile/Gowri%20S%20Paramasivam/Cryptography211242005003308AM/Cryptography2.aspx

  • #766098
    Hi,
    You can do it using itextSharp, a free pdf operations library.
    Please find code for implementing digital signatures using iTexstSharp:
    http://www.codeproject.com/Articles/14488/E-signing-PDF-documents-with-iTextSharp

  • #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
    http://www.codeproject.com/Articles/14488/E-signing-PDF-documents-with-iTextSharp
    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
    https://www.signfiles.com/signature-library/

    Thanks
    Koolprasd2003
    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.Open();
    document.Add(new Paragraph("Hello World"));
    document.Close();
    writer.Close();
    Response.ContentType = "pdf/application";
    Response.AddHeader("content-disposition",
    "attachment;filename=First PDF document.pdf");
    Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length);
    }

    By Nathan
    Direction is important than speed

  • #766157
    Hi,
    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:

    http://www.c-sharpcorner.com/UploadFile/7e13e6/protect-pdf-via-digital-signature-using-spire-pdf/

  • #766189
    Firstly, thanks for all who have guided me. Hi bharati, I have tried the examples listed in the link: http://www.signfiles.com/manuals/SignatureLibraryUserManual.pdf 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
    Hi,
    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