override public void Execute()
        {
            IDictionary <string, string> additionalRequestHeaders = new Dictionary <string, string>();

            additionalRequestHeaders.Add("customHeader1", "value1");
            additionalRequestHeaders.Add("customHeader2", "value2");
            additionalRequestHeaders.Add("customHeader3", "value3");
            additionalRequestHeaders.Add("customHeader4", "value4");

            eslClient = new EslClient(props.Get("api.key"), props.Get("api.url"), true, null, additionalRequestHeaders);

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(PackageName)
                                                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithInPerson())
                                                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                            .WithFirstName("John1")
                                                            .WithLastName("Smith1"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100)))
                                                .Build();

            packageId = eslClient.CreatePackage(superDuperPackage);
            eslClient.SendPackage(packageId);
            retrievedPackage = eslClient.GetPackage(packageId);
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("C# Package " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100))
                                                    .WithSignature(SignatureBuilder.InitialsFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 200))
                                                    .WithSignature(SignatureBuilder.CaptureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 300)))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document-with-fields.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("Field extraction example")
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .EnableExtraction()
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .WithName("AGENT_SIG_1")
                                                                   .EnableExtraction())
                                                    .WithInjectedField(FieldBuilder.Label()
                                                                       .WithName("AGENT_SIG_2")
                                                                       .WithValue("Value to be stamped")))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/src/document.pdf");

            DocumentPackage package = PackageBuilder.NewPackageNamed("Fields example " + DateTime.Now)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed("My Document")
                                                    .FromFile(file.FullName)
                                                    .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100)
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 200)
                                                                              .WithValidation(FieldValidatorBuilder.Alphabetic()
                                                                                              .MaxLength(10)
                                                                                              .MinLength(3)
                                                                                              .Required()
                                                                                              .WithErrorMessage("This field is not alphabetic")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 300)
                                                                              .WithValidation(FieldValidatorBuilder.Numeric()
                                                                                              .WithErrorMessage("This field is not numeric")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 400)
                                                                              .WithValidation(FieldValidatorBuilder.Alphanumeric()
                                                                                              .WithErrorMessage("This field is not alphanumeric")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 500)
                                                                              .WithValidation(FieldValidatorBuilder.Email()
                                                                                              .WithErrorMessage("The value in this field is not an email address")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 600)
                                                                              .WithValidation(FieldValidatorBuilder.URL()
                                                                                              .WithErrorMessage("The value in this field is not a valid URL")))
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .OnPage(0)
                                                                              .AtPosition(500, 700)
                                                                              .WithValidation(FieldValidatorBuilder.Regex("^[0-9a-zA-Z]+$")
                                                                                              .WithErrorMessage("The value in this field does not match the expression")))))
                                      .Build();

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            EslClient client = new EslClient(apiToken, baseUrl);
            //Get my hands on the list of signers somehow...
            List <SignerInfo> signers = Signers();
            //Get my hands on the list of documents somehow...
            List <DocumentInfo> documents = Documents();

            PackageBuilder packageBuilder = PackageBuilder.NewPackageNamed("Package with variable number of signers and documents")
                                            .DescribedAs("This is a new package");

            foreach (SignerInfo signer in signers)
            {
                packageBuilder.WithSigner(SignerBuilder.NewSignerWithEmail(signer.Email)
                                          .WithFirstName(signer.FirstName)
                                          .WithLastName(signer.LastName)
                                          .Build());
            }

            foreach (DocumentInfo document in documents)
            {
                DocumentBuilder documentBuilder = DocumentBuilder.NewDocumentNamed(document.Name).FromFile(document.File.FullName);

                foreach (SignerInfo signer in signers)
                {
                    documentBuilder.WithSignature(SignatureBuilder.SignatureFor(signer.Email)
                                                  .OnPage(0)
                                                  .AtPosition(500, 100)
                                                  .Build());
                }
            }

            PackageId id = client.CreatePackage(packageBuilder.Build());

            client.SendPackage(id);

            Console.WriteLine("Package {0} was sent", id.Id);
        }
Beispiel #6
0
        public static void Main(string[] args)
        {
            EslClient eslClient = new EslClient(apiToken, baseUrl);

            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed("Sample Insurance policy")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail("*****@*****.**")
                                                            .WithFirstName("John")
                                                            .WithLastName("Smith"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("First Document")
                                                              .FromFile("src/document-with-fields.pdf")
                                                              .WithSignature(SignatureBuilder.SignatureFor("*****@*****.**")
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100))
                                                              .WithInjectedField(FieldBuilder.TextField()
                                                                                 .WithId("AGENT_SIG_1")
                                                                                 .WithPositionExtracted()
                                                                                 .WithName("AGENT_SIG_1")
                                                                                 .WithValue("Test Value")))
                                                .Build();

            PackageId packageId = eslClient.CreatePackage(superDuperPackage);

            eslClient.SendPackage(packageId);
        }