Blog: Developer

e-SignLive How To: Document Extraction (.NET SDK)

esignlive feedback icon

I have seen a couple questions recently about using document extraction, so I thought it would be good to create a blog about it. Anytime I do a blog about how to use a feature, I will put it under the “e-SignLive How To” series.

Configuring the PDF Form Fields

First things first, you will need a PDF with form fields, named how e-SignLive can recognize them. You can see more about the proper format of the form field names in the documentation. Below is the PDF document that I used. I put the form field names on the fields in the image to show what I named everything.


As you can see, the two signers on the document will be “Signer1” and “Preparer1”. These will be the custom IDs used in the code section below, letting e-SignLive know what fields to associate with each signer.

eSignLive Developer Community!

Join the eSignLive Developer Community!
Forums, blogs, documentation, SDK downloads and more.

Join Today

The Code

So, with your document set up properly, you can now write your code. For this blog, I will be using C# and the e-SignLive .NET SDK. Below, you will find the code I used for my example PDF, above.

using System;
using System.IO;
using Silanis.ESL.SDK;
using Silanis.ESL.SDK.Builder;
using System.Diagnostics;

namespace CreateAndSendPackage
    class CreateAndSendPackage
        private static String apiUrl = "";
        private static String apiKey = "YOUR_API_KEY";

        public static void Main(string[] args)
            EslClient eslClient = new EslClient(apiKey, apiUrl);
            FileStream fileStream1 = File.OpenRead("C:/PATH_TO_FILE/sampleDocumentExtract.pdf");

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Test Document Extraction")
                                  .FromStream(fileStream1, DocumentType.PDF)
            PackageId packageId = eslClient.CreatePackage(superDuperPackage);

The code for this example is quite simple and the part of it that is associated with just this feature is even simpler. In each “WithSigner” call, you will see that the custom IDs coincide with the ones in the image of the PDF form shown earlier in the blog. The .WithDocument also has a call to “EnableExtraction”. Because this is done, you might notice that you do not have to define the signature locations and who needs to sign the document. This is already taken care of with the Ids and the associated form field names from the PDF.

What it looks like

Once your run this code, the package is created with the appropriate fields for each signer. This is what Signer1 will see:


As you see, the required fields are highlighted for the user to fill out. The Name field will be filled in automatically by e-SignLive when the signing is complete.

Likewise, the preparer sees this:


There you have it. The signing process happens just as you have defined it in your package.

Thanks for reading! If you have any questions or there are any topics you would like to see covered in my blog, feel free to post in the comments section. If you want to see more posts from me, see my author page.

– Michael Williams
Twitter | Facebook | LinkedIn

4 Responses to “e-SignLive How To: Document Extraction (.NET SDK)”



    What’s the best way to extract multiple docs from package in case there could be multiple? (Get collection’s count, then extract inividualy, …)

  2. Michael Williams

    For each document, you’d just use the .EnableExtraction() with your PDF form fields named in the appropriate manner. Let me know if I’m misunderstanding the question.



      For each document, you’d just use the .EnableExtraction() with your PDF form fields named in the appropriate manner. Let me know if I’m misunderstanding the question.


    Frank povazanj

    I am not able to get this working with my PDF. Would you be bale to send me the PDF file which you used in this example?


Leave a Reply