public static void createPackage() { // 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") .WithId("SIGNER1")) .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.CreateAndSendPackage(package); Console.WriteLine("Package was created and sent", id.Id); // Optionally, get the session token for integrated signing. SessionToken sessionToken = client.SessionService.CreateSessionToken(id, "SIGNER1"); }
override public void Execute() { package1 = PackageBuilder.NewPackageNamed("ProxyConfigurationExample1: " + DateTime.Now) .DescribedAs("This is a new package1") .WithSigner(SignerBuilder.NewSignerWithEmail(email1) .WithCustomId("signer1") .WithFirstName("John") .WithLastName("Smith")) .WithDocument(DocumentBuilder.NewDocumentNamed("My Document1") .FromStream(fileStream1, DocumentType.PDF) .WithSignature(SignatureBuilder.SignatureFor(email1) .OnPage(0) .AtPosition(100, 100))) .Build(); packageId1 = eslClientWithHttpProxy.CreateAndSendPackage(package1); eslClientWithHttpProxy.SignDocuments(packageId1); eslClientWithHttpProxy.SignDocuments(packageId1, "signer1"); package2 = PackageBuilder.NewPackageNamed("ProxyConfigurationExample2: " + DateTime.Now) .DescribedAs("This is a new package2") .WithSigner(SignerBuilder.NewSignerWithEmail(email1) .WithCustomId("signer2") .WithFirstName("John") .WithLastName("Smith")) .WithDocument(DocumentBuilder.NewDocumentNamed("My Document2") .FromStream(fileStream2, DocumentType.PDF) .WithSignature(SignatureBuilder.SignatureFor(email1) .OnPage(0) .AtPosition(100, 100))) .Build(); packageId2 = eslClientWithHttpProxyHasCredentials.CreateAndSendPackage(package2); eslClientWithHttpProxyHasCredentials.SignDocuments(packageId2); eslClientWithHttpProxyHasCredentials.SignDocuments(packageId2, "signer2"); }