SignDoc SDK (C++)  5.0.0
SignDocRenderParameters Class Reference

Parameters for SignDocDocument::renderPageAsImage() and SignDocDocument::renderPageAsSignDocImage(). More...

#include <SignDocSDK-cpp.h>

Public Types

enum  Type {
  t_undefined = 0, t_boolean = 1, t_integer = 2, t_number = 3,
  t_string = 4, t_string2 = 6
}
 Return values of getType(). More...
 

Public Member Functions

 SignDocRenderParameters ()
 Constructor. More...
 
 SignDocRenderParameters (const SignDocRenderParameters &aSource)
 Copy constructor. More...
 
 ~SignDocRenderParameters ()
 Destructor. More...
 
SignDocRenderParametersoperator= (const SignDocRenderParameters &aSource)
 Assignment operator. More...
 
void clear ()
 Reset all parameters to their initial values. More...
 
ReturnCode setBoolean (const std::string &aName, bool aValue)
 Set a boolean parameter. More...
 
ReturnCode setInteger (const std::string &aName, int aValue)
 Set an integer parameter. More...
 
ReturnCode setNumber (const std::string &aName, double aValue)
 Set a floating-point number parameter. More...
 
ReturnCode setString (Encoding aEncoding, const std::string &aName, const std::string &aValue)
 Set a string parameter. More...
 
ReturnCode setString2 (Encoding aEncoding, const std::string &aName, const std::string &aName2, const std::string &aValue)
 Set a string parameter with two parameter names. More...
 
ReturnCode setString2Wide (const std::string &aName, const wchar_t *aName2, const std::string &aValue)
 Set a string parameter (with two parameter names, the second one being aa wide string). More...
 
const int * getBoolean (const std::string &aName) const
 Get the value of a boolean parameter. More...
 
const int * getInteger (const std::string &aName) const
 Get the value of an integer parameter. More...
 
const double * getNumber (const std::string &aName) const
 Get the value of a floating-point number parameter. More...
 
const char * getString (const std::string &aName) const
 Get the value of a string parameter. More...
 
const char * getString2 (const std::string &aName, const std::string &aName2) const
 Get the value of a string parameter (with two parameter names). More...
 
bool operator== (const SignDocRenderParameters &aRHS) const
 Compare against another SignDocRenderParameters object. More...
 
const char * getErrorMessage (Encoding aEncoding) const
 Get an error message for the last function call. More...
 
const wchar_t * getErrorMessageW () const
 Get an error message for the last function call. More...
 
 SignDocRenderParameters (SIGNDOC_RenderParameters *aP)
 Internal function. More...
 
SIGNDOC_RenderParameters * getImpl ()
 Internal function. More...
 
const SIGNDOC_RenderParameters * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_RenderParameters *aP)
 Internal function. More...
 

Static Public Member Functions

static Type getType (const std::string &aName)
 Get the type of a parameter. More...
 

Detailed Description

Member Enumeration Documentation

enum Type

Return values of getType().

Enumerator
t_undefined 

The specified parameter is not defined.

t_boolean 

Boolean.

See also
getBoolean(), setBoolean()
t_integer 

Integer.

See also
getInteger(), setInteger()
t_number 

Floating-point number.

See also
getNumber(), setNumber()
t_string 

String.

See also
getString(), setString()
t_string2 

String (with two parameter names).

See also
getString2(), setString2()

Constructor & Destructor Documentation

Constructor.

SignDocRenderParameters ( const SignDocRenderParameters aSource)
inline

Copy constructor.

Parameters
[in]aSourceThe object to be copied.

Destructor.

SignDocRenderParameters ( SIGNDOC_RenderParameters *  aP)
inline

Internal function.

Member Function Documentation

void clear ( )
inline

Reset all parameters to their initial values.

const int * getBoolean ( const std::string &  aName) const
inline

Get the value of a boolean parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
A pointer to the value of the specified parameter or nullptr if the parameter is not set or is not a boolean parameter.
See also
setBoolean()
const char * getErrorMessage ( Encoding  aEncoding) const
inline

Get an error message for the last function 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 function call. 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()
const wchar_t * getErrorMessageW ( ) const
inline

Get an error message for the last function call.

Returns
A pointer to a string describing the reason for the failure of the last function call. 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()
SIGNDOC_RenderParameters* getImpl ( )
inline

Internal function.

const SIGNDOC_RenderParameters* getImpl ( ) const
inline

Internal function.

const int * getInteger ( const std::string &  aName) const
inline

Get the value of an integer parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
A pointer to the value of the specified parameter or nullptr if the parameter is not set or is not an integer parameter.
See also
setInteger()
const double * getNumber ( const std::string &  aName) const
inline

Get the value of a floating-point number parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
A pointer to the value of the specified parameter or nullptr if the parameter is not set or is not a floating-point number parameter.
See also
setNumber()
const char * getString ( const std::string &  aName) const
inline

Get the value of a string parameter.

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive, UTF-8).
Returns
A pointer to the value of the specified parameter or nullptr if the parameter is not set.
See also
getErrorMessage(), setString()
const char * getString2 ( const std::string &  aName,
const std::string &  aName2 
) const
inline

Get the value of a string parameter (with two parameter names).

This function does not set an error message.

Parameters
[in]aNameThe name of the parameter (case-sensitive, UTF-8).
[in]aName2The second name of the parameter (case-sensitive, UTF-8).
Returns
A pointer to the value of the specified parameter or nullptr if the parameter is not set.
See also
getErrorMessage(), setString()
SignDocRenderParameters::Type getType ( const std::string &  aName)
inlinestatic

Get the type of a parameter.

Parameters
[in]aNameThe name of the parameter (case-sensitive).
Returns
The type of the parameter, see enum Type.
SignDocRenderParameters & operator= ( const SignDocRenderParameters aSource)
inline

Assignment operator.

Parameters
[in]aSourceThe source object.
Returns
This object.
bool operator== ( const SignDocRenderParameters aRHS) const
inline

Compare against another SignDocRenderParameters object.

Parameters
[in]aRHSThe object to compare against.
Returns
true iff this object compares equal to aRHS.
ReturnCode setBoolean ( const std::string &  aName,
bool  aValue 
)
inline

Set a boolean parameter.

The following boolean parameters are available:

  • AddDecorations: Enable rendering of decorations of signature fields of PDF documents. If true, an icon visualizing the signature status will be added to each signature field:

    • no icon (signature field not signed)
    • green check mark (signature is OK)
    • green check mark with yellow triangle (signature is OK but the certificate is not trusted or the document has been extended, ie, modified and saved incrementally after signing)
    • red cross (signature broken)

    You might want to set boolean parameter "UseModificationState" to true to compute the signature state more thoroughly.

    Enabling rendering of decorations can slow down SignDocDocument::renderPageAsImage() and SignDocDocument::renderPageAsSignDocImage() substantially for PDF documents as each call will validate all the signatures of the page. Moreover, long term validation (LTV) is currently not supported by SignDocDocument::renderPageAsImage() and SignDocDocument::renderPageAsSignDocImage(). Setting string parameter (with two parameter names) "DecorationState" might solve these problems.

    It is recommended to display the status of signatures off-page rather than using this parameter, see SignDocDocument::getSignature().

    For TIFF documents, this parameter is ignored; a red cross will be displayed in signature fields if the signature is broken.

  • BlackAndWhite: true to force black and white output (1 bit per pixel), false to use RGB for PDF documents or to keep the pixel format of TIFF documents. The default value is false.
  • ForPrinting: true to enable rendering for printing, false to enable rendering for displaying. This may affect rendering of annotations in PDF documents.
  • HighQualityScaling: Quality for scaling pages of TIFF documents. true for high quality (slow), false for low quality (fast). The default value is false.
  • Interlaced: true to create an interlaced image (progressive encoding). The default value is false.
  • UseModificationState: true to check the modification state for signature fields of PDF documents (expensive), false to ignore the modification state. The default value is false. This parameter has an effect only if boolean parameter "Decorations" is true.
Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
getBoolean(), setInteger(), setNumber(), setString()
void setImpl ( SIGNDOC_RenderParameters *  aP)
inline

Internal function.

ReturnCode setInteger ( const std::string &  aName,
int  aValue 
)
inline

Set an integer parameter.

The following integer parameters are available:

  • FirstPage: Render a range of pages. The value is the 1-based page number of the first page. "LastPage" must also be set. If both parameter are set to the same value, getInteger() will return that value for parameter "Page". Rendering ranges of pages is not yet implemented for TIFF documents.
  • Height: The height for automatic computation of the scaling factor to make the rendered image fit the specified height in pixels. If this parameter is set, floating-point number parameter "Scale" will be ignored.
  • LastPage: Render a range of pages. The value is the 1-based page number of the last page. "FirstPage" must also be set. If both parameter are set to the same value, getInteger() will return that value for parameter "Page". Rendering ranges of pages is not yet implemented for TIFF documents.
  • Page: Render a single page. The value is the 1-based page number of that page. Setting this parameter will set both "FirstPage" and "LastPage".
  • Width: The width for automatic computation of the scaling factor to make the rendered image fit the specified width in pixels. If this parameter is set, floating-point number parameter "Scale" will be ignored.
Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
getInteger(), setBoolean(), setNumber(), setString()
ReturnCode setNumber ( const std::string &  aName,
double  aValue 
)
inline

Set a floating-point number parameter.

The following floating-point number parameters are available:

  • Resolution: The resolution for rendering PDF documents. Setting this parameter is equivalent to setting both "ResolutionX" and "ResolutionY". See also floating-point number parameter "Scale".
  • ResolutionX: The horizontal resolution for rendering PDF documents. The value of this parameter will be ignored for TIFF documents as the resolution is computed automatically from the scaling factor and the document's resolution. If this parameter is not set, but "ResolutionY" is set, the value of parameter "ResolutionY" will be used for both the horizontal and the vertical resolution. If neither parameter is set, 96 DPI (subject to change) will be used for rendering PDF documents. See also floating-point number parameter "Scale".
  • ResolutionY: The vertical resolution for rendering PDF documents. The value of this parameter will be ignored for TIFF documents as the resolution is computed automatically from the scaling factor and the document's resolution. If this parameter is not set, but "ResolutionX" is set, the value of parameter "ResolutionX" will be used for both the horizontal and the vertical resolution. If neither parameter is set, 96 DPI (subject to change) will be used for rendering PDF documents. See also floating-point number parameter "Scale".
  • Scale: Scaling factor. There is no default value, ie, either this parameter or at least one of integer parameters "Height" and "Width" must be set. This parameter will be ignored if integer parameter "Height" or "Width" is set. See also floating-point number parameters "Resolution", "ResolutionX", and "ResolutionY".
Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter.
Returns
ReturnCode::rc_ok iff successful.
See also
getNumber(), setBoolean(), setInteger(), setString()
ReturnCode setString ( Encoding  aEncoding,
const std::string &  aName,
const std::string &  aValue 
)
inline

Set a string parameter.

The following string parameters are available:

  • Compression: Compression method. The following values are available:
    • "default": no compression for PDF documents, same compression as the source document for TIFF documents.
    • "none": no compression
    • "ccitt4": CCITT Group 4
    • "lzw": LZW
    • "rle": RLE
    • "zip": ZIP
    The default value is "default".
  • Format: The image format, "jpg", "png", "tiff", "gif", or "bmp". For SignDocDocument::renderPageAsImage(), this parameter must be set, there is no default value. For SignDocDocument::renderPageAsSignDocImage(), this parameter is ignored.
Parameters
[in]aEncodingThe encoding used for aName and aValue.
[in]aNameThe name of the parameter (case-sensitive).
[in]aValueThe value of the parameter. The encoding is specified by aEncoding.
Returns
ReturnCode::rc_ok iff successful.
See also
getString(), setBoolean(), setInteger(), setNumber(), setString2()
ReturnCode setString2 ( Encoding  aEncoding,
const std::string &  aName,
const std::string &  aName2,
const std::string &  aValue 
)
inline

Set a string parameter with two parameter names.

The following string parameters with two parameter names are available:

  • DecorationState: Set the decoration state for a single signature in a PDF document. aName2 is the name of the field (not checked by this function). The decorations set by this parameter are ignored unless boolean parameter "AddDecorations" is set to true. This parameter is ignored for rendering TIFF documents. The following values are available:
    • "auto": validate signature and choose appropriate decoration.
    • "empty": the signature field is not signed.
    • "ok": signature validated successfully.
    • "problem": signature validated mostly successfully, there is at least one problem.
    • "broken": signature is broken.
    Value "auto" will be assumed for all fields for which this parameter is set.
Parameters
[in]aEncodingThe encoding used for aName2 and aValue.
[in]aNameThe name of the parameter (case-sensitive).
[in]aName2The second name of the parameter (case-sensitive).
[in]aValueThe value of the parameter. The encoding is specified by aEncoding.
Returns
ReturnCode::rc_ok iff successful.
See also
getString(), setBoolean(), setInteger(), setNumber(), setString2()
ReturnCode setString2Wide ( const std::string &  aName,
const wchar_t *  aName2,
const std::string &  aValue 
)
inline

Set a string parameter (with two parameter names, the second one being aa wide string).

See setString2() for the available parameters.

Note
Unlike SignDoc*Parameters_setString() functions taking a pointer to a wide string, this one has a wide parameter name and a narrow value.
Parameters
[in]aNameThe name of the parameter (case-sensitive).
[in]aName2The second name of the parameter (case-sensitive).
[in]aValueThe value of the parameter (UTF-8).
Returns
ReturnCode::rc_ok iff successful.
See also
getString(), setBoolean(), setInteger(), setNumber()

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