Skip to main content

Quick start

This guide walks you through a complete signature with the MobbSign Windows SDK: your app shows a PDF, the user signs it with their handwritten signature, and the SDK returns the signed document.

#StepCall
1Add the viewMobbSignView
2Configure the licenseConfigureLicense()
3Set the encryption keySetEncryptionKey()
4Listen to the eventsOn… +=
5Load the documentLoadPDFDocument()
Before you begin

The SDK is installed and you have a license key and the public encryption key of your project.

1. Add the view​

Create MobbSignView in your page and add it to the main container:

public MainPage()
{
this.InitializeComponent();
this.MobbSignView = new MobbSignView();
this.LayoutRoot.Children.Add(this.MobbSignView);
}

To customise the view, pass a dictionary of customisation properties to the constructor.

2. Configure the license​

Configure the license before any other call:

this.MobbSignView.ConfigureLicense("YOUR_LICENSE_KEY");

The OnCheckLicense event notifies the result of the validation.

3. Set the encryption key​

Set the public key that encrypts the biometric data of every signature:

this.MobbSignView.SetEncryptionKey(new Uri("ms-appx:///Assets/Keys/public.key"));

The OnCheckEncryptionKey event notifies whether the key is valid.

4. Listen to the events​

Subscribe to the events you need:

this.MobbSignView.OnDocumentShown += MobbSignView_OnDocumentShown;
this.MobbSignView.OnSignButtonPressed += MobbSignView_OnSignButtonPressed;
this.MobbSignView.OnSignatureAcquised += MobbSignView_OnSignatureAcquised;
this.MobbSignView.OnSignatureDeleted += MobbSignView_OnSignatureDeleted;
this.MobbSignView.OnDocumentSigned += MobbSignView_OnDocumentSigned;
this.MobbSignView.OnDocumentFormSaved += MobbSignView_OnDocumentFormSaved;
this.MobbSignView.OnBackButtonPressed += MobbSignView_OnBackButtonPressed;
this.MobbSignView.OnProcessEnd += MobbSignView_OnProcessEnd;
this.MobbSignView.OnErrorOccurred += MobbSignView_OnErrorOccurred;
this.MobbSignView.OnCheckLicense += MobbSignView_OnCheckLicense;
this.MobbSignView.OnCheckEncryptionKey += MobbSignView_OnCheckEncryptionKey;
EventRaised when
OnDocumentShownThe document has been loaded and shown.
OnSignButtonPressedThe user taps Sign.
OnSignatureAcquisedThe user has drawn a signature, before it is confirmed.
OnSignatureDeletedThe user has deleted the signature drawn.
OnDocumentSignedA signature has been added to the document.
OnDocumentFormSavedThe form fields of the document have been saved.
OnBackButtonPressedThe user taps Back.
OnProcessEndThe user has finished: the signed document is available.
OnErrorOccurredAn error has occurred.
OnCheckLicenseThe license has been validated.
OnCheckEncryptionKeyThe encryption key has been checked.

5. Load the document​

StorageFile file = e.Parameter as StorageFile;
if (file != null)
{
await this.MobbSignView.LoadPDFDocument(file, "Service contract");
}

The document can also be loaded from its content, and its form fields can be filled in when it is loaded:

MethodLoads the document
Task LoadPDFDocument(StorageFile originFile, string name)From a file.
void LoadPDFDocument(StorageFile originFile, string name, Dictionary<string, object> inputFields)From a file, filling in the form fields.
Task LoadPDFDocumentFromData(byte[] data, string name)From its content.
void LoadPDFDocumentFromData(byte[] data, string name, Dictionary<string, object> inputFields)From its content, filling in the form fields.

The viewer opens the document. The user taps Sign, draws their signature and confirms it. When they finish, OnProcessEnd is raised.

Next step​

Control the process from your own interface in Signing process.