SignDoc SDK API Documentation (C++)

SignDoc SDK Version 4.3.1

Overview

SignDoc SDK enables the creation of applications which handle SignDoc documents, that is, rendering as images, signing, and verifying PDF and TIFF documents.

Components

SignDoc SDK is comprised of these components:

Main Classes

The main classes of the C++ API of SignDoc SDK are: SignDocDocumentLoader, SignDocDocument, SignDocPdfDocumentHandler, and SignDocTiffDocumentHandler.

Files

SignDoc SDK contains these directories:

Win64
Executables, DLLs, and libraries for 64-bit Windows
WinRT_X64
DLLs and libraries for X64 (64-bit) Windows Store apps.
android-armv7a
libraries for Android (armeabi v7a)
android-arm64v8a
libraries for Android (arm64 v8a)
darwin-x86_64
libraries for OS X
ios-universal
libraries for iOS
linux-x86_64
Executables and libraries for 64-bit x86 Linux
doc/c
Documentation for the C API
doc/c++
Documentation for the C++ API
doc/java
Documentation for the Java API
include
C++ header files for SignDoc SDK

Important files include:

License*.txt
Licenses for third party libraries
ios-universal/libSPSignDoc_4.3.a
static library for iOS containing SignDoc SDK and all required dependencies
linux-ARCH/init-*
/etc/init.d scripts for various Linux distributions (only needed if udev is not used)
linux-ARCH/install-signpad.sh
Script for installing SignPad support
linux-ARCH/libSPFreeImage_1.so
shared library containing an adaption of FreeImage
linux-ARCH/libSPSignDoc_4.3.so
shared library containing the SignDoc SDK core
linux-ARCH/libSPTiff_31.so
shared library containing an adaption of libtiff
linux-ARCH/splm2.so
shared library containing the license manager
linux-ARCH/udev-signpad-*.rules
udev rules for SignPad
Win.../SPSignDocQt.dll
DLL containing SignDoc SDK code depending on SPQt (MS Visual Studio 2008)
Win.../SPSignDoc_4.3.dll
DLL containing the SignDoc SDK core (MS Visual Studio 2008)
Win.../SPSignDoc_4.3.lib
Import library for SPSignDoc4.3.dll (MS Visual Studio 2008)
Win.../SP9_QtCore4.dll
DLL containing an adaption of QtCore4.dll (MS Visual Studio 2008)
Win.../SP9_QtGui4.dll
DLL containing an adaption of QtGui4.dll (MS Visual Studio 2008)
Win.../SPFreeImage_1.dll
DLL containing an adaption of FreeImage
Win.../splm2.dll
DLL containing the license manager
Win.../splm2lv.dll
DLL containing License Viewer for Qt 3.3.5 (used by splm2view.exe)
Win.../splm2lv453.dll
DLL containing License Viewer for Qt 4.x (MS Visual Studio 2008)
Win.../splm2view.exe
Invokes the License Viewer
Win.../SPTiff_31.dll
DLL containing an adaption of libtiff
WinRT.../SPSignDoc_4.3_app.dll
DLL containing the SignDoc SDK core for Windows Store apps (MS Visual Studio 2013)
WinRT.../SPSignDoc_4.3_app.lib
Import library for SPSignDoc4.3_app.dll (MS Visual Studio 2013)

Windows

To be able to use SPSignDoc_4.3.dll, you have to install these Microsoft Visual C++ Redistributable Packages:

License Files

This chapter describes how to use license files. Note that you should use license keys instead of license files, see License Keys. Usage of license files is deprecated. For OS X and for Windows Store apps, only license keys are supported.

Under Windows, the license for SignDoc SDK is managed by SPLM2.dll, which must reside in a directory listed in the PATH environment variable. The license file, SignDocSDK.lic, must be put into a subdirectory named LMDATA of the directory containing SPLM2.dll. Write access to the license file must be granted.

Under Linux, the license for SignDoc SDK is managed by splm2.so, which must reside in /lib or /usr/lib. Create the text file /etc/softpro/splm2.cfg containing

SignDocSDK.lic = /var/softpro/SignDocSDK.lic

and put the correct pathname of the license file after the equal sign. Write access to the license file must be granted.

Under iOS, the license for SignDoc SDK must be in the application home directory.

Under Android, the license for SignDoc SDK must be in the files directory of the application. Your application should create that directory and copy the license file from its resources to that directory.

Under Windows, the license can be displayed by typing

splm2view SignDocSDK

on the command line.

License Keys

If you have a license key (rather than a license file, see License Files), just pass it as array of bytes to the de::softpro::doc::SignDocDocumentLoader::setLicenseKey() function before calling any other SignDoc SDK function.

Usually, license keys consist of multiple lines, which is a bit inconvenient for string literals. You may replace newline characters in the license key with '|' (vertical bar, 0x7c) characters to put the entire license key into a single line. If there already are any '|' characters in a multi-line license key, replace them with "\!" (backslash bang, 0x5c 0x21) before replacing newlines with '|'.

Using SignDoc SDK in iOS apps

Using SignDoc SDK in Windows Store apps

Coordinate Systems

SignDoc uses two distinct coordinate systems:

The origin of the document coordinate system is in the bottom left corner of the page (as rendered, that is, taking rotation of PDF pages into account). Points having positive X coordinates are to the right of the origin, points having positive Y coordinates are above the origin.

For PDF documents, the origin is in that corner of the intersection of the CropBox and the MediaBox of the page that corresponds to the bottom left corner of the image that would be rendered for that page. The units are specified by the PDF document and are usually 1/72 inch (see SignDocDocument::getConversionFactors()).

For TIFF documents, the origin is in the bottom left corner of the page, the unit is one pixel (see SignDocDocument::getResolution()).

The origin of the canvas coordinate system is in the upper left corner of the image. Points having positive X coordinates are to the right of the origin, points having positive Y coordinates are below the origin. The unit is one pixel.

Temporary Files

Under Linux, temporary files are stored in the directory specified by the TMPDIR environment variable. If TMPDIR is not set, /tmp will be used.

Under iOS, the application's temporary directory will be used for temporary files.

Under Android, the application's cache directory will be used for temporary files.

Trusted Root Certificates

Under Windows, SignDoc SDK verifies certificates against trusted root certificates in the Windows Certificate Store.

Under Linux and OS X, SignDoc SDK uses OpenSSL for verifying certificates. The OpenSSL root directory is /etc/softpro/ssl. Put trusted certificates into file /etc/softpro/ssl/cert.pem or create a hashed directory of certificates in /etc/softpro/ssl/certs. You can also make /etc/softpro/ssl a symbolic link to /etc/ssl to use the certificates trusted by the operating system.

Under iOS, SignDoc SDK uses OpenSSL for verifying certificates as the certificate verification function of iOS does not provide enough information. Unfortunately, the trusted certificates of iOS (anchor certificates) cannot be exported and thus cannot be used by OpenSSL. The OpenSSL root directory is ssl in the application bundle directory. Put trusted certificates into file ssl/cert.pem of your application bundle or create a hashed directory of certificates in ssl/certs.

Under Android, SignDoc SDK uses OpenSSL for verifying certificates. The OpenSSL root directory is files/ssl in the application directory. Put trusted certificates into file files/ssl/cert.pem or create a hashed directory of certificates in files/ssl/certs.

You can change the trusted certificates file and directory used by OpenSSL by setting environment variables SSL_CERT_FILE and SSL_CERT_DIR, respectively.