Public Types | Public Member Functions | Static Public Member Functions

de::softpro::doc::SignDocDocumentLoader Class Reference

Create SignDocDocument objects. More...

#include <SignDocSDK-cpp.h>

Public Types

enum  RemainingDays { rd_product, rd_signing }
 

Specify which expiry date shall be used by getRemainingDays().

More...
enum  Flags { f_map_into_memory = 0x01 }
 

Flags for setFlags().

More...

Public Member Functions

 SignDocDocumentLoader ()
 Constructor.
 ~SignDocDocumentLoader ()
 Destructor.
SignDocDocumentloadFromMemory (const unsigned char *aData, size_t aSize, bool aCopy)
 Load a document from memory.
SignDocDocumentloadFromFile (Encoding aEncoding, const char *aPath, bool aWritable)
 Load a document from a file.
SignDocDocumentloadFromFile (const wchar_t *aPath, bool aWritable)
 Load a document from a file.
SignDocDocumentcreatePDF (int aMajor, int aMinor)
 Create an empty PDF document.
SignDocDocumentcreatePDFA (int aMajor, int aMinor, const char *aConformance, const unsigned char *aICCPtr, size_t aICCSize)
 Create an empty PDF/A document.
SignDocDocument::DocumentType ping (InputStream &aStream)
 Determine the type of a document.
bool loadFontConfigFile (Encoding aEncoding, const char *aPath)
 Load font configuration from a file.
bool loadFontConfigFile (const wchar_t *aPath)
 Load font configuration from a file.
bool loadFontConfigEnvironment (const char *aName)
 Load font configuration from files specified by an environment variable.
bool loadFontConfigStream (InputStream &aStream, Encoding aEncoding, const char *aDirectory)
 Load font configuration from a stream.
bool loadFontConfigStream (InputStream &aStream, const wchar_t *aDirectory)
 Load font configuration from a stream.
bool loadPdfFontConfigFile (Encoding aEncoding, const char *aPath)
 Load font configuration for PDF documents from a file.
bool loadPdfFontConfigFile (const wchar_t *aPath)
 Load font configuration for PDF documents from a file.
bool loadPdfFontConfigEnvironment (const char *aName)
 Load font configuration for PDF documents from files specified by an environment variable.
bool loadPdfFontConfigStream (InputStream &aStream, Encoding aEncoding, const char *aDirectory)
 Load font configuration for PDF documents from a stream.
bool loadPdfFontConfigStream (InputStream &aStream, const wchar_t *aDirectory)
 Load font configuration for PDF documents from a stream.
void getFailedFontFiles (std::vector< std::string > &aOutput)
 Get the pathnames of font files that failed to load for the most recent loadFontConfig*() or loadPdfFontConfig*() call.
bool loadTrustedCertificatesFromFile (Encoding aEncoding, const char *aPath)
 Load trusted root CA certifcates from a file.
bool loadTrustedCertificatesFromFile (const wchar_t *aPath)
 Load trusted root CA certifcates from a file.
bool loadTrustedCertificatesFromStream (InputStream &aStream)
 Load trusted root CA certifcates from a stream.
bool initLogging (Encoding aEncoding, const char *aLevel, const char *aPathname)
 Initialize logging.
const char * getErrorMessage (Encoding aEncoding) const
 Get an error message for the last load*(), ping(), or initLogging() call.
const wchar_t * getErrorMessageW () const
 Get an error message for the last load*(), ping(), or initLogging() call.
bool registerDocumentHandler (SignDocDocumentHandler *aHandler)
 Register a document handler.
void setFlags (unsigned aFlags)
 Set flags modifying the behavior of this SignDocDocumentLoader object and of the SignDocDocument objects created by it.
 SignDocDocumentLoader (SIGNDOC_DocumentLoader *aP)
 Internal function.
SIGNDOC_DocumentLoader * getImpl ()
 Internal function.
const SIGNDOC_DocumentLoader * getImpl () const
 Internal function.
void setImpl (SIGNDOC_DocumentLoader *aP)
 Internal function.

Static Public Member Functions

static bool initLicenseManager (int aWho1, int aWho2)
 Initialize license management.
static bool setLicenseKey (const void *aKeyPtr, size_t aKeySize, const char *aProduct, const char *aVersion, const void *aTokenPtr, size_t aTokenSize)
 Initialize license management with license key.
static bool generateLicenseToken (const char *aProduct, std::vector< unsigned char > &aOutput)
 Generate a license token for other SDKs also covered by the license key passed to setLicenseKey().
static int getRemainingDays (RemainingDays aWhat)
 Get the number of days until the license will expire.
static bool getInstallationCode (std::string &aCode)
 Get the installation code needed for creating a license file.
static bool getVersionNumber (std::string &aVersion)
 Get the version number of SignDocShared or SignDoc SDK.
static bool getComponentVersionNumber (const char *aComponent, std::string &aVersion)
 Get the version number of a SignDoc SDK component.
static int getLicenseTextCount ()
 Get the number of license texts.
static const char * getLicenseText (int aIndex)
 Get a license text.

Detailed Description

Create SignDocDocument objects.

Use getErrorMessage() to get more information after a function call failed.

As the error message is stored in this object, each thread should have its own instance of SignDocDocumentLoader or synchronization should be used.

Unless you need differently configured SignDocDocumentLoader objects, you should have only one SignDocDocumentLoader object per process (but see above). Loading font configuration files can be expensive, in particular if many fonts have to be scanned.

To be able to load documents, you have to register at least one document handler by passing a pointer to a SignDocDocumentHandler object to registerDocumentHandler().


Member Enumeration Documentation

Flags for setFlags().

Enumerator:
f_map_into_memory 

Map input files into memory.

If this flag is set, loadFromFile() and other functions will try to map their input file into memory. Doing that may improve performance (on Android, in particular) but read errors and truncating the file will crash the process.

This flag is just a hint and may be ignored.

Specify which expiry date shall be used by getRemainingDays().

Enumerator:
rd_product 

Use the expiry date for the product.

rd_signing 

Use the expiry date for signing documents.


Constructor & Destructor Documentation

de::softpro::doc::SignDocDocumentLoader::SignDocDocumentLoader (  ) [inline]

Constructor.

de::softpro::doc::SignDocDocumentLoader::~SignDocDocumentLoader (  ) [inline]

Destructor.

de::softpro::doc::SignDocDocumentLoader::SignDocDocumentLoader ( SIGNDOC_DocumentLoader *  aP ) [inline]

Internal function.


Member Function Documentation

SignDocDocument* de::softpro::doc::SignDocDocumentLoader::createPDF ( int  aMajor,
int  aMinor 
) [inline]

Create an empty PDF document.

The PDF document is invalid until you add at least one page.

Parameters:
[in]aMajorMajor PDF version, must be 1 or 2.
[in]aMinorMinor PDF version, must be 0 through 7 (if aMajor is 1) or 0 (if aMajor is 2).
Returns:
A pointer to a new SignDocDocument object representing the document, NULL if the document could not be created. The caller is responsible for destroying the object.
See also:
getErrorMessage()
SignDocDocument* de::softpro::doc::SignDocDocumentLoader::createPDFA ( int  aMajor,
int  aMinor,
const char *  aConformance,
const unsigned char *  aICCPtr,
size_t  aICCSize 
) [inline]

Create an empty PDF/A document.

The PDF document is invalid until you add at least one page.

Parameters:
[in]aMajorMajor PDF version, must be 1.
[in]aMinorMinor PDF version, must be 0 through 7.
[in]aConformancePDF/A conformance. The string pointed to by this argument must consist of two characters:

  • A digit (1 through 3) specifying the part of PDF/A the document shall conform to.
  • A letter ('A' or 'B' if the digit is '1', 'A', 'B', or 'U' of the digit is '2' or '3') specifying the PDF/A conformance.

For instance, use "2B" for PDF/A-2b.

[in]aICCPtrA pointer to the first octet of the ICC profile of the PDF/A output intent or NULL if no output intent shall be added to the document.
[in]aICCSizeNumber of octets pointed to by aICCPtr or 0 if aICCPtr is NULL.
Returns:
A pointer to a new SignDocDocument object representing the document, NULL if the document could not be created. The caller is responsible for destroying the object.
See also:
getErrorMessage()
static bool de::softpro::doc::SignDocDocumentLoader::generateLicenseToken ( const char *  aProduct,
std::vector< unsigned char > &  aOutput 
) [inline, static]

Generate a license token for other SDKs also covered by the license key passed to setLicenseKey().

Parameters:
[in]aProductThe name of the product which shall be able to use the license key without providing a product version.
[out]aOutputThe token will be stored here.
Returns:
true if successful, false on error.
See also:
setLicenseKey()
static bool de::softpro::doc::SignDocDocumentLoader::getComponentVersionNumber ( const char *  aComponent,
std::string &  aVersion 
) [inline, static]

Get the version number of a SignDoc SDK component.

Parameters:
[in]aComponentThe component. Currently supported are "sppdf", "splm2", and "spooc".
[out]aVersionThe version number will be stored here. It consists of 3 or 4 integers separated by dots, .e.g., "1.9.27".
Returns:
true if successful, false on error.
See also:
getVersionNumber()
const char* de::softpro::doc::SignDocDocumentLoader::getErrorMessage ( Encoding  aEncoding ) const [inline]

Get an error message for the last load*(), ping(), or initLogging() call.

Parameters:
[in]aEncodingThe encoding to be used for the error message.
Returns:
A pointer to a string describing the reason for the failure of the last call of load*() or ping(). The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also:
getErrorMessageW(), loadFontConfigEnvironment(), loadFontConfigFile(), loadFontConfigStream(), loadFontConfigStream(), loadFromFile(), loadFromMemory(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream(), ping()
const wchar_t* de::softpro::doc::SignDocDocumentLoader::getErrorMessageW (  ) const [inline]

Get an error message for the last load*(), ping(), or initLogging() call.

Returns:
A pointer to a string describing the reason for the failure of the last call of load*() or ping(). The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also:
getErrorMessage(), loadFontConfigEnvironment(), loadFontConfigFile(), loadFontConfigStream(), loadFontConfigStream(), loadFromFile(), loadFromMemory(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream(), ping()
void de::softpro::doc::SignDocDocumentLoader::getFailedFontFiles ( std::vector< std::string > &  aOutput ) [inline]

Get the pathnames of font files that failed to load for the most recent loadFontConfig*() or loadPdfFontConfig*() call.

This includes files that could not be found and files that could not be loaded. In the former case, the pathname may contain wildcard characters.

Note that loadFontConfig*() and loadPdfFontConfig() no longer fail if a specified font file cannot be found or loaded.

Parameters:
[out]aOutputThe pathnames will be stored here.
See also:
loadFontConfigEnvironment(), loadFontConfigFile(), loadFontConfigStream(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream()
SIGNDOC_DocumentLoader* de::softpro::doc::SignDocDocumentLoader::getImpl (  ) [inline]

Internal function.

const SIGNDOC_DocumentLoader* de::softpro::doc::SignDocDocumentLoader::getImpl (  ) const [inline]

Internal function.

static bool de::softpro::doc::SignDocDocumentLoader::getInstallationCode ( std::string &  aCode ) [inline, static]

Get the installation code needed for creating a license file.

Parameters:
[out]aCodeThe installation code will be stored here. Only ASCII characters are used.
Returns:
true if successful, false on error.
static const char* de::softpro::doc::SignDocDocumentLoader::getLicenseText ( int  aIndex ) [inline, static]

Get a license text.

SignDoc SDK includes several Open Source components. You can retrieve the license texts one by one.

Parameters:
[in]aIndexThe zero-based index of the license text.
Returns:
A pointer to the null-terminated license text. Lines are terminated by LF characters. If aIndex is invalid, NULL will be returned.
See also:
getLicenseTextCount()
static int de::softpro::doc::SignDocDocumentLoader::getLicenseTextCount (  ) [inline, static]

Get the number of license texts.

SignDoc SDK includes several Open Source components. You can retrieve the license texts one by one.

Returns:
The number of license texts.
See also:
getLicenseText()
static int de::softpro::doc::SignDocDocumentLoader::getRemainingDays ( RemainingDays  aWhat ) [inline, static]

Get the number of days until the license will expire.

Parameters:
[in]aWhatSelect which expiry date shall be used (rd_product or rd_signing).
Returns:
-1 if the license has already expired or is invalid, 0 if the license will expire today, a positive value for the number of days the license is still valid. For licenses without expiry date, that will be several millions of days.
static bool de::softpro::doc::SignDocDocumentLoader::getVersionNumber ( std::string &  aVersion ) [inline, static]

Get the version number of SignDocShared or SignDoc SDK.

Parameters:
[out]aVersionThe version number will be stored here. It consists of 3 integers separated by dots, .e.g., "1.16.7"
Returns:
true if successful, false on error.
See also:
getComponentVersionNumber()
static bool de::softpro::doc::SignDocDocumentLoader::initLicenseManager ( int  aWho1,
int  aWho2 
) [inline, static]

Initialize license management.

License management must be initialized before the non-static methods of SignDocDocumentLoader can be used.

Deprecated:
Usage of license files is deprecated, please use a license key, see setLicenseKey().
Parameters:
[in]aWho1The first magic number for the product.
[in]aWho2The second magic number for the product.
Returns:
true if successful, false on error.
See also:
setLicenseKey()
bool de::softpro::doc::SignDocDocumentLoader::initLogging ( Encoding  aEncoding,
const char *  aLevel,
const char *  aPathname 
) [inline]

Initialize logging.

This function initializes logging for all threads of the current process. This function is non-static to enable getErrorMessage(); the logging configuration is not restricted to this SignDocDocumentLoader object.

Parameters:
[in]aEncodingThe encoding of the string pointed to by aPathname.
[in]aLevelThe logging level: "0" (log nothing) through "5" (log everything), optionally followed by "T" to log process and thread IDs.
[in]aPathnameThe pathname of the log file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns:
true iff successful.
See also:
getErrorMessage()
bool de::softpro::doc::SignDocDocumentLoader::loadFontConfigEnvironment ( const char *  aName ) [inline]

Load font configuration from files specified by an environment variable.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

Under Windows, directories are separated by semicolons. Under Unix, directories are separated by colons.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aNameThe name of the environment variable.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadFontConfigFile(), loadFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadFontConfigFile ( Encoding  aEncoding,
const char *  aPath 
) [inline]

Load font configuration from a file.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadFontConfigEnvironment(), loadFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadFontConfigFile ( const wchar_t *  aPath ) [inline]

Load font configuration from a file.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aPathThe pathname of the file.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadFontConfigEnvironment(), loadFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadFontConfigStream ( InputStream aStream,
Encoding  aEncoding,
const char *  aDirectory 
) [inline]

Load font configuration from a stream.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryIf non-NULL, relative font pathnames will be relative to this directory. The directory must exist and must be readable. If NULL, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadFontConfigEnvironment(), loadFontConfigFile()
bool de::softpro::doc::SignDocDocumentLoader::loadFontConfigStream ( InputStream aStream,
const wchar_t *  aDirectory 
) [inline]

Load font configuration from a stream.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aDirectoryIf non-NULL, relative font pathnames will be relative to this directory. The directory must exist and must be readable. If NULL, relative font pathnames will make this function fail.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadFontConfigEnvironment(), loadFontConfigFile()
SignDocDocument* de::softpro::doc::SignDocDocumentLoader::loadFromFile ( Encoding  aEncoding,
const char *  aPath,
bool  aWritable 
) [inline]

Load a document from a file.

Signing the document will overwrite the document, but see integer parameter "Optimize" of SignDocSignatureParameters.

You can open FDF files that reference a PDF file; the referenced PDF file will be opened and the FDF file will be applied to the loaded copy (using sff_fail). If the pathname of the referenced PDF file is not an absolute pathname, it will be interpreted as being relative to the directory containing the FDF file.

Parameters:
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathPathname of the document file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
[in]aWritableOpen for writing (used for signing TIFF documents in place, ignored for PDF documents).
Returns:
A pointer to a new SignDocDocument object representing the document, NULL if the document could not be loaded. The caller is responsible for destroying the object.
See also:
getErrorMessage(), loadFromMemory(), SignDocDocument::applyFdf(), SignDocSignatureParameters::setInteger()
SignDocDocument* de::softpro::doc::SignDocDocumentLoader::loadFromFile ( const wchar_t *  aPath,
bool  aWritable 
) [inline]

Load a document from a file.

Signing the document will overwrite the document, but see integer parameter "Optimize" of SignDocSignatureParameters.

You can open FDF files that reference a PDF file; the referenced PDF file will be opened and the FDF file will be applied to the loaded copy (using sff_fail). If the pathname of the referenced PDF file is not an absolute pathname, it will be interpreted as being relative to the directory containing the FDF file.

Parameters:
[in]aPathPathname of the document file.
[in]aWritableOpen for writing (used for signing TIFF documents in place, ignored for PDF documents).
Returns:
A pointer to a new SignDocDocument object representing the document, NULL if the document could not be loaded. The caller is responsible for destroying the object.
See also:
getErrorMessage(), loadFromMemory(), SignDocDocument::applyFdf(), SignDocSignatureParameters::setInteger()
SignDocDocument* de::softpro::doc::SignDocDocumentLoader::loadFromMemory ( const unsigned char *  aData,
size_t  aSize,
bool  aCopy 
) [inline]

Load a document from memory.

Parameters:
[in]aDataPointer to the first octet of the document. This array of octets must live at least as long as the returned object unless aCopy is true.
[in]aCopytrue to make a copy of the array of octets pointed to by aData.
[in]aSizeSize of the document (number of octets).
Returns:
A pointer to a new SignDocDocument object representing the document, NULL if the document could not be loaded. The caller is responsible for destroying the object.
See also:
getErrorMessage(), loadFromFile()
bool de::softpro::doc::SignDocDocumentLoader::loadPdfFontConfigEnvironment ( const char *  aName ) [inline]

Load font configuration for PDF documents from files specified by an environment variable.

Additional fonts may be required for rendering PDF documents. The font configuration for PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Under Windows, directories are separated by semicolons. Under Unix, directories are separated by colons.

See section Font Configuration.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aNameThe name of the environment variable.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadPdfFontConfigFile(), loadPdfFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadPdfFontConfigFile ( Encoding  aEncoding,
const char *  aPath 
) [inline]

Load font configuration for PDF documents from a file.

Additional fonts may be required for rendering PDF documents. The font configuration for PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadPdfFontConfigEnvironment(), loadPdfFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadPdfFontConfigFile ( const wchar_t *  aPath ) [inline]

Load font configuration for PDF documents from a file.

Additional fonts may be required for rendering PDF documents. The font configuration for PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aPathThe pathname of the file.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadPdfFontConfigEnvironment(), loadPdfFontConfigStream()
bool de::softpro::doc::SignDocDocumentLoader::loadPdfFontConfigStream ( InputStream aStream,
const wchar_t *  aDirectory 
) [inline]

Load font configuration for PDF documents from a stream.

Additional fonts may be required for rendering PDF documents. The font configuration for PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aDirectoryIf non-NULL, relative font pathnames will be relative to this directory. The directory must exist and must be readable. If NULL, relative font pathnames will make this function fail.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile()
bool de::softpro::doc::SignDocDocumentLoader::loadPdfFontConfigStream ( InputStream aStream,
Encoding  aEncoding,
const char *  aDirectory 
) [inline]

Load font configuration for PDF documents from a stream.

Additional fonts may be required for rendering PDF documents. The font configuration for PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters:
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryIf non-NULL, relative font pathnames will be relative to this directory. The directory must exist and must be readable. If NULL, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns:
true if successful, false on error.
See also:
getFailedFontFiles(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile()
bool de::softpro::doc::SignDocDocumentLoader::loadTrustedCertificatesFromFile ( const wchar_t *  aPath ) [inline]

Load trusted root CA certifcates from a file.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The file must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Parameters:
[in]aPathThe pathname of the file.
Returns:
true if successful, false on error.
See also:
loadTrustedCertificatesFromStream()
bool de::softpro::doc::SignDocDocumentLoader::loadTrustedCertificatesFromFile ( Encoding  aEncoding,
const char *  aPath 
) [inline]

Load trusted root CA certifcates from a file.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The file must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Calls to loadTrustedCertificatesFromFile() and loadTrustedCertificatesFromStream() are cumulative.

Parameters:
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file.
Returns:
true if successful, false on error.
See also:
loadTrustedCertificatesFromStream()
bool de::softpro::doc::SignDocDocumentLoader::loadTrustedCertificatesFromStream ( InputStream aStream ) [inline]

Load trusted root CA certifcates from a stream.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The stream must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Parameters:
[in]aStreamThe certificates will be read from this stream.
Returns:
true if successful, false on error.
See also:
loadTrustedCertificatesFromFile()
SignDocDocument::DocumentType de::softpro::doc::SignDocDocumentLoader::ping ( InputStream aStream ) [inline]

Determine the type of a document.

Parameters:
[in]aStreamA seekable stream for the document.
Returns:
The type of the document, SignDocDocument::dt_unknown on error.
See also:
getErrorMessage()
bool de::softpro::doc::SignDocDocumentLoader::registerDocumentHandler ( SignDocDocumentHandler aHandler ) [inline]

Register a document handler.

The behavior is undefined if multiple handlers for the same document type are registered.

Parameters:
[in]aHandlerAn instance of a document handler. This object takes ownerswhip of the object.
Returns:
true iff successful.
void de::softpro::doc::SignDocDocumentLoader::setFlags ( unsigned  aFlags ) [inline]

Set flags modifying the behavior of this SignDocDocumentLoader object and of the SignDocDocument objects created by it.

Parameters:
[in]aFlagsThe flags, see enum Flags.
void de::softpro::doc::SignDocDocumentLoader::setImpl ( SIGNDOC_DocumentLoader *  aP ) [inline]

Internal function.

static bool de::softpro::doc::SignDocDocumentLoader::setLicenseKey ( const void *  aKeyPtr,
size_t  aKeySize,
const char *  aProduct,
const char *  aVersion,
const void *  aTokenPtr,
size_t  aTokenSize 
) [inline, static]

Initialize license management with license key.

License management must be initialized before the non-static methods of SignDocDocumentLoader can be used.

Parameters:
[in]aKeyPtrPointer to the first character of the license key.
[in]aKeySizeSize in octets of the license key, not including any terminating NUL character.
[in]aProductShould be NULL.
[in]aVersionShould be NULL.
[in]aTokenPtrNULL or pointer to the first octet of the token. Should be NULL.
[in]aTokenSizeSize in octets of the token. Should be 0.
Returns:
true if successful, false on error.
See also:
generateLicenseToken(), initLicenseManager()

The documentation for this class was generated from the following file: