Exemple #1
0
        public void creatingDropListFieldSetsStyle()
        {
            Field field = FieldBuilder.DropList().AtPosition(100, 100).Build();

            Assert.AreEqual(FieldStyle.DROP_LIST, field.Style);
        }
Exemple #2
0
        override public void Execute()
        {
            DocumentPackage package = PackageBuilder.NewPackageNamed(PackageName)
                                      .DescribedAs("This is a new package")
                                      .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                  .WithFirstName("John")
                                                  .WithLastName("Smith"))
                                      .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                                                    .FromStream(fileStream1, DocumentType.PDF)
                                                    .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                   .OnPage(0)
                                                                   .AtPosition(500, 100)
                                                                   .WithField(FieldBuilder.TextField()
                                                                              .WithId(TEXTFIELD_ID)
                                                                              .WithFontSize(TEXTFIELD_FONT_SIZE)
                                                                              .OnPage(TEXTFIELD_PAGE)
                                                                              .AtPosition(500, 200))
                                                                   .WithField(FieldBuilder.CheckBox()
                                                                              .WithId(CHECKBOX_ID)
                                                                              .WithValue(CHECKBOX_VALUE)
                                                                              .OnPage(CHECKBOX_PAGE)
                                                                              .AtPosition(500, 300))
                                                                   .WithField(FieldBuilder.RadioButton(RADIO_GROUP_1)
                                                                              .WithId(RADIO_ID_1)
                                                                              .WithValue(false)
                                                                              .WithSize(RADIO_WIDTH, RADIO_HEIGHT)
                                                                              .OnPage(RADIO_PAGE)
                                                                              .AtPosition(500, 400))
                                                                   .WithField(FieldBuilder.RadioButton(RADIO_GROUP_1)
                                                                              .WithId(RADIO_ID_2)
                                                                              .WithValue(true)
                                                                              .WithSize(RADIO_WIDTH, RADIO_HEIGHT)
                                                                              .OnPage(RADIO_PAGE)
                                                                              .AtPosition(500, 450))
                                                                   .WithField(FieldBuilder.RadioButton(RADIO_GROUP_2)
                                                                              .WithId(RADIO_ID_3)
                                                                              .WithValue(true)
                                                                              .WithSize(RADIO_WIDTH, RADIO_HEIGHT)
                                                                              .OnPage(RADIO_PAGE)
                                                                              .AtPosition(500, 500))
                                                                   .WithField(FieldBuilder.RadioButton(RADIO_GROUP_2)
                                                                              .WithId(RADIO_ID_4)
                                                                              .WithValue(false)
                                                                              .WithSize(RADIO_WIDTH, RADIO_HEIGHT)
                                                                              .OnPage(RADIO_PAGE)
                                                                              .AtPosition(500, 550))
                                                                   .WithField(FieldBuilder.DropList()
                                                                              .WithId(DROP_LIST_ID)
                                                                              .WithValue(DROP_LIST_OPTION2)
                                                                              .WithFontSize(DROP_LIST_FONT_SIZE)
                                                                              .WithValidation(FieldValidatorBuilder.Basic()
                                                                                              .WithOption(DROP_LIST_OPTION1)
                                                                                              .WithOption(DROP_LIST_OPTION2)
                                                                                              .WithOption(DROP_LIST_OPTION3))
                                                                              .OnPage(DROP_LIST_PAGE)
                                                                              .WithSize(100, 200)
                                                                              .AtPosition(100, 100))
                                                                   .WithField(FieldBuilder.TextArea()
                                                                              .WithId(TEXT_AREA_ID)
                                                                              .WithValue(TEXT_AREA_VALUE)
                                                                              .WithFontSize(TEXT_AREA_FONT_SIZE)
                                                                              .OnPage(TEXT_AREA_PAGE)
                                                                              .WithSize(400, 600)
                                                                              .AtPosition(200, 200))
                                                                   .WithField(FieldBuilder.Label()
                                                                              .WithId(LABEL_ID)
                                                                              .WithValue(LABEL_VALUE)
                                                                              .WithFontSize(LABEL_FIELD_FONT_SIZE)
                                                                              .OnPage(LABEL_PAGE)
                                                                              .WithSize(100, 60)
                                                                              .AtPosition(220, 220))
                                                                   .WithField(FieldBuilder.Datepicker()
                                                                              .WithId(DATEPICKER_ID)
                                                                              .WithName(DATEPICKER_NAME)
                                                                              .WithValue(DATEPICKER_VALUE)
                                                                              .WithFontSize(DATEPICKER_FIELD_FONT_SIZE)
                                                                              .OnPage(DATEPICKER_PAGE)
                                                                              .WithSize(100, 60)
                                                                              .AtPosition(150, 150)
                                                                              .WithValidation(FieldValidatorBuilder.DatepickerFormat(DATEPICKER_FORMAT)
                                                                                              .Required()))))
                                      .Build();

            packageId = eslClient.CreatePackage(package);

            eslClient.SendPackage(PackageId);
            retrievedPackage = eslClient.GetPackage(packageId);
        }
Exemple #3
0
        override public void Execute()
        {
            DocumentPackage template = PackageBuilder.NewPackageNamed(TEMPLATE_NAME)
                                       .DescribedAs(PACKAGE_DESCRIPTION)
                                       .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                   .WithFirstName(TEMPLATE_SIGNER1_FIRST)
                                                   .WithLastName(TEMPLATE_SIGNER1_LAST))
                                       .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                                                     .FromStream(fileStream1, DocumentType.PDF)
                                                     .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                    .OnPage(0)
                                                                    .AtPosition(400, 100)
                                                                    .WithField(FieldBuilder.TextField()
                                                                               .WithId(TEXTFIELD_ID)
                                                                               .OnPage(TEXTFIELD_PAGE)
                                                                               .AtPosition(textfieldPositionX, textfieldPositionY))
                                                                    .WithField(FieldBuilder.CheckBox()
                                                                               .WithId(CHECKBOX_1_ID)
                                                                               .OnPage(CHECKBOX_1_PAGE)
                                                                               .WithSize(checkbox1Width, checkbox1Height)
                                                                               .AtPosition(checkbox1PositionX, checkbox1PositionY))
                                                                    .WithField(FieldBuilder.CheckBox()
                                                                               .WithId(CHECKBOX_2_ID)
                                                                               .WithValue(CHECKBOX_2_VALUE)
                                                                               .OnPage(CHECKBOX_2_PAGE)
                                                                               .WithSize(checkbox2Width, checkbox2Height)
                                                                               .AtPosition(checkbox2PositionX, checkbox2PositionY))
                                                                    .WithField(FieldBuilder.RadioButton(RADIO_1_GROUP)
                                                                               .WithId(RADIO_1_ID)
                                                                               .OnPage(RADIO_1_PAGE)
                                                                               .WithSize(radio1Width, radio1Height)
                                                                               .AtPosition(radio1PositionX, radio1PositionY))
                                                                    .WithField(FieldBuilder.RadioButton(RADIO_2_GROUP)
                                                                               .WithId(RADIO_2_ID)
                                                                               .WithValue(RADIO_2_VALUE)
                                                                               .OnPage(RADIO_2_PAGE)
                                                                               .WithSize(radio2Width, radio2Height)
                                                                               .AtPosition(radio2PositionX, radio2PositionY))
                                                                    .WithField(FieldBuilder.DropList()
                                                                               .WithId(DROP_LIST_ID)
                                                                               .WithValue(DROP_LIST_OPTION2)
                                                                               .WithValidation(FieldValidatorBuilder.Basic()
                                                                                               .WithOption(DROP_LIST_OPTION1)
                                                                                               .WithOption(DROP_LIST_OPTION2)
                                                                                               .WithOption(DROP_LIST_OPTION3))
                                                                               .OnPage(DROP_LIST_PAGE)
                                                                               .WithSize(dropListWidth, dropListHeight)
                                                                               .AtPosition(dropListPositionX, dropListPositionY))
                                                                    .WithField(FieldBuilder.TextArea()
                                                                               .WithId(TEXT_AREA_ID)
                                                                               .WithValue(TEXT_AREA_VALUE)
                                                                               .OnPage(TEXT_AREA_PAGE)
                                                                               .WithSize(textAreaWidth, textAreaHeight)
                                                                               .AtPosition(textAreaPositionX, textAreaPositionY))
                                                                    .WithField(FieldBuilder.Label()
                                                                               .WithId(LABEL_ID)
                                                                               .WithValue(LABEL_VALUE)
                                                                               .OnPage(LABEL_PAGE)
                                                                               .WithSize(labelFieldWidth, labelFieldHeight)
                                                                               .AtPosition(labelFieldPositionX, labelFieldPositionY))))
                                       .Build();

            PackageId templateId = eslClient.CreateTemplate(template);

            template.Id = templateId;

            DocumentPackage newPackage = PackageBuilder.NewPackageNamed(PackageName)
                                         .DescribedAs(PACKAGE_DESCRIPTION)
                                         .WithEmailMessage(PACKAGE_EMAIL_MESSAGE)
                                         .WithSigner(SignerBuilder.NewSignerWithEmail(email2)
                                                     .WithFirstName(PACKAGE_SIGNER2_FIRST)
                                                     .WithLastName(PACKAGE_SIGNER2_LAST)
                                                     .WithTitle(PACKAGE_SIGNER2_TITLE)
                                                     .WithCompany(PACKAGE_SIGNER2_COMPANY)
                                                     .WithCustomId(PACKAGE_SIGNER2_CUSTOM_ID))
                                         .Build();

            packageId        = eslClient.CreatePackageFromTemplate(templateId, newPackage);
            retrievedPackage = eslClient.GetPackage(packageId);
        }