com.silanis.esl.sdk.examples.BrandingBarConfigurationExample Maven / Gradle / Ivy
package com.silanis.esl.sdk.examples;
import com.silanis.esl.sdk.DocumentPackage;
import com.silanis.esl.sdk.DocumentType;
import static com.silanis.esl.sdk.builder.CeremonyLayoutSettingsBuilder.newCeremonyLayoutSettings;
import static com.silanis.esl.sdk.builder.DocumentBuilder.newDocumentWithName;
import static com.silanis.esl.sdk.builder.DocumentPackageSettingsBuilder.newDocumentPackageSettings;
import static com.silanis.esl.sdk.builder.PackageBuilder.newPackageNamed;
import static com.silanis.esl.sdk.builder.SignatureBuilder.signatureFor;
import static com.silanis.esl.sdk.builder.SignerBuilder.newSignerWithEmail;
/**
* Basic package with in-person mode set at the document package level. Expires in a month.
*/
public class BrandingBarConfigurationExample extends SDKSample {
public static void main( String... args ) {
new BrandingBarConfigurationExample().run();
}
public void execute() {
DocumentPackage superDuperPackage = newPackageNamed(getPackageName())
.describedAs( "This is a package created using OneSpan Sign SDK" )
.withSettings( newDocumentPackageSettings()
.withoutOptOut()
.withoutDocumentToolbarDownloadButton()
.withCeremonyLayoutSettings( newCeremonyLayoutSettings()
.withoutGlobalNavigation()
.withoutGlobalDownloadButton()
) )
.withSigner( newSignerWithEmail( email1 )
.withFirstName( "John" )
.withLastName( "Smith" )
.withTitle( "Managing Director" )
.withCompany( "Acme Inc." ) )
.withDocument( newDocumentWithName( "First Document" )
.fromStream( documentInputStream1, DocumentType.PDF )
.withSignature( signatureFor( email1 )
.onPage( 0 )
.atPosition( 100, 100 ) ) )
.build();
packageId = eslClient.createPackage( superDuperPackage );
eslClient.sendPackage( packageId );
retrievedPackage = eslClient.getPackage( packageId );
}
}