예제 #1
0
        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");

            ossClient = new OssClient(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 = ossClient.CreatePackage(superDuperPackage);
            ossClient.SendPackage(packageId);
            retrievedPackage = ossClient.GetPackage(packageId);
        }
예제 #2
0
        override public void Execute()
        {
            DocumentPackage superDuperPackage = PackageBuilder.NewPackageNamed(PackageName)
                                                .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings().WithInPerson())
                                                .WithSigner(SignerBuilder.NewSignerWithEmail(email1)
                                                            .WithFirstName("One1")
                                                            .WithLastName("Span1")
                                                            .WithLocalLanguage())
                                                .WithDocument(DocumentBuilder.NewDocumentNamed(DOCUMENT_NAME)
                                                              .FromStream(fileStream1, DocumentType.PDF)
                                                              .WithSignature(SignatureBuilder.SignatureFor(email1)
                                                                             .OnPage(0)
                                                                             .AtPosition(100, 100)))
                                                .Build();

            packageId = OssClient.CreatePackage(superDuperPackage);
            OssClient.SendPackage(packageId);
        }
        public static void Main(string[] args)
        {
            // Create new esl client with api token and base url
            OssClient client = new OssClient(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);
        }
        public static void Main(string[] args)
        {
            // Create new oss client with api token and base url
            OssClient client = new OssClient(apiToken, baseUrl);
            FileInfo  file   = new FileInfo(Directory.GetCurrentDirectory() + "/SampleDocuments/document.pdf");

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

            PackageId id = client.CreatePackage(package);

            client.SendPackage(id);
        }