How to

The Signature API combines signature device handling with PDF document capabilities.

The Signature API automates
- signing a document using a signature device and
- displaying a document on a signature device.

How to start

The prerequisites for signing is a PDF document and an attached signature device.

The Signature API relies on the DeviceAPI for the device handling.
Use a Driver object of the /wiki/spaces/NETDEVAPI/pages/79527946 to search and select the desired signature device.

Then, pass the driver object together with the document to Sig.SignAPI.SigningFactory.StartAsync.
to get a signing object in case of success.

This signing object has exposes the driver object and a PDF client object.
Use the driver object for changing device settings.
Use the PDF client object for PDF operations.

Sign a document

PDF documents may have an interactive form (AcroForm).
This form may have various fields of different types.
Signature fields are a special type of form field for signing.

If a signature field exists, it has a name and a position.
If that existing field shall be signed,
passing name and position in the sign request tells the Signature API to do so.

Query the PDF client about the form fields.
to get the name and the position of an existing signature field.

If a new signature field shall be signed,
choosing a unique name and a position for the new field tells the Signature API to do so.

In order to choose the position for the new field,
knowing the desired page number and the size of that page is essential.

To that end, query the PDF client about the page sizes.

One way to get an idea where to put the new field is
to use the text search capability of the PDF client.
For example, one could search for terms like "Please sign" or "Sign here".
Which terms are advisable depends on the type of contract and the language.

Viewing a document

can be started on supported devices after choosing the page number to start at.
One may further choose zoom level.
The default zoom level fits the width of the document page to the width of the device display.


The calculation of the PDF coordinates

The placement of the signature field is done by PDF coordinates. The top/left of a page has the value 0/0 and for the calculation you can use the following formula:

A4= 8.27 x 11.69 inch with 72points/inch = 595x842 points

1 point = 0.03527777778 centimeters

1point = 0.01388888889 inch

Example: 5cm are 142 points (5cm / 0.03527777778 = 141,7323)