SignDoc SDK (C)  5.0.0
SIGNDOC_TextFieldAttributes Class Reference

Attributes of a text field, list box field or combo box field used for the construction of the appearance (PDF documents only). More...

#include <SignDocSDK-c.h>

Public Member Functions

struct SIGNDOC_TextFieldAttributesSIGNDOC_TextFieldAttributes_new (struct SIGNDOC_Exception **aEx)
 SIGNDOC_TextFieldAttributes constructor. More...
 
struct SIGNDOC_TextFieldAttributesSIGNDOC_TextFieldAttributes_clone (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aSource)
 Clone a SIGNDOC_TextFieldAttributes object. More...
 
void SIGNDOC_TextFieldAttributes_delete (struct SIGNDOC_TextFieldAttributes *aObj)
 SIGNDOC_TextFieldAttributes destructor. More...
 
void SIGNDOC_TextFieldAttributes_assign (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj, const struct SIGNDOC_TextFieldAttributes *aSource)
 SIGNDOC_TextFieldAttributes assignment operator. More...
 
SIGNDOC_Boolean SIGNDOC_TextFieldAttributes_isSet (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj)
 Check if text field attributes are set or not. More...
 
SIGNDOC_Boolean SIGNDOC_TextFieldAttributes_isValid (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj)
 Check if the text field attributes are valid. More...
 
void SIGNDOC_TextFieldAttributes_clear (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj)
 Unset all attributes. More...
 
char * SIGNDOC_TextFieldAttributes_getFontName (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj, int aEncoding)
 Get the name of the font. More...
 
void SIGNDOC_TextFieldAttributes_setFontName (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj, int aEncoding, const char *aFontName)
 Set the name of the font. More...
 
char * SIGNDOC_TextFieldAttributes_getFontResourceName (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj, int aEncoding)
 Get the resource name of the font. More...
 
double SIGNDOC_TextFieldAttributes_getFontSize (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj)
 Get the font size. More...
 
void SIGNDOC_TextFieldAttributes_setFontSize (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj, double aFontSize)
 Set the font size. More...
 
struct SIGNDOC_ColorSIGNDOC_TextFieldAttributes_getTextColor (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj)
 Get the text color. More...
 
void SIGNDOC_TextFieldAttributes_setTextColor (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj, const struct SIGNDOC_Color *aTextColor)
 Set the text color. More...
 
char * SIGNDOC_TextFieldAttributes_getRest (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_TextFieldAttributes *aObj, int aEncoding)
 Get unparsed parts of default appearance string. More...
 
void SIGNDOC_TextFieldAttributes_setRest (struct SIGNDOC_Exception **aEx, struct SIGNDOC_TextFieldAttributes *aObj, int aEncoding, const char *aInput)
 Set unparsed parts of default appearance string. More...
 

Detailed Description

Attributes of a text field, list box field or combo box field used for the construction of the appearance (PDF documents only).

This class represents a PDF default appearance string.

Modifying an object of this type does not modify the underlying field or document. Use SIGNDOC_Document_setTextFieldAttributes() or SIGNDOC_Field_setTextFieldAttributes() to update the text attributes of a field or of the document.

See also
SIGNDOC_Document_getTextFieldAttributes(), SIGNDOC_Document_setTextFieldAttributes(), SIGNDOC_Field_getTextFieldAttributes(), SIGNDOC_Field_setTextFieldAttributes()

Member Function Documentation

void SIGNDOC_TextFieldAttributes_assign ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj,
const struct SIGNDOC_TextFieldAttributes aSource 
)

SIGNDOC_TextFieldAttributes assignment operator.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aSourceThe source object.
void SIGNDOC_TextFieldAttributes_clear ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj 
)

Unset all attributes.

SIGNDOC_TextFieldAttributes_isSet() will return SIGNDOC_FALSE.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
struct SIGNDOC_TextFieldAttributes * SIGNDOC_TextFieldAttributes_clone ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aSource 
)

Clone a SIGNDOC_TextFieldAttributes object.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aSourceThe object to be copied.
void SIGNDOC_TextFieldAttributes_delete ( struct SIGNDOC_TextFieldAttributes aObj)

SIGNDOC_TextFieldAttributes destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
char * SIGNDOC_TextFieldAttributes_getFontName ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj,
int  aEncoding 
)

Get the name of the font.

This function returns an empty string if SIGNDOC_TextFieldAttributes_isSet() would return SIGNDOC_FALSE.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
The name of the font, "?" if the font is invalid. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_TextFieldAttributes_getFontResourceName(), SIGNDOC_TextFieldAttributes_getFontSize(), SIGNDOC_TextFieldAttributes_setFontName()
char * SIGNDOC_TextFieldAttributes_getFontResourceName ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj,
int  aEncoding 
)

Get the resource name of the font.

This function returns an empty string if SIGNDOC_TextFieldAttributes_isSet() would return SIGNDOC_FALSE.

Note that setting the resource name is not possible.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
The resource name of the font. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_TextFieldAttributes_getFontName()
double SIGNDOC_TextFieldAttributes_getFontSize ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj 
)

Get the font size.

This function returns 0 if SIGNDOC_TextFieldAttributes_isSet() would return SIGNDOC_FALSE.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
Returns
The font size (in user space units). If the font size is 0, the default font size (which depends on the field size) will be used.
See also
SIGNDOC_TextFieldAttributes_getFontName(), SIGNDOC_TextFieldAttributes_setFontSize()
char * SIGNDOC_TextFieldAttributes_getRest ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj,
int  aEncoding 
)

Get unparsed parts of default appearance string.

If this function returns a non-empty string, there are unsupported operators in the default appearance string.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
Concatenated unparsed parts of the default appearance string, ie, the default appearance string sans font name, font size, and text color. If this function returns a non-empty string, it will start with a space character. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_TextFieldAttributes_setRest()
struct SIGNDOC_Color * SIGNDOC_TextFieldAttributes_getTextColor ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj 
)

Get the text color.

This function returns NULL if SIGNDOC_TextFieldAttributes_isSet() would return SIGNDOC_FALSE.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
Returns
A pointer to an object describing the text color or NULL if the text color is not available. The caller is responsible for destroying the object with SIGNDOC_Color_delete().
See also
SIGNDOC_TextFieldAttributes_setTextColor(), SIGNDOC_Color_delete()
SIGNDOC_Boolean SIGNDOC_TextFieldAttributes_isSet ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj 
)

Check if text field attributes are set or not.

If this function returns SIGNDOC_FALSE for a SIGNDOC_TextFieldAttributes object retrieved from a text field, the document's default text field attributes will be used (if present).

This function returns SIGNDOC_FALSE for all SIGNDOC_TextFieldAttributes objects retrieved from TIFF documents (but you can set the attributes anyway, making SIGNDOC_TextFieldAttributes_isSet() return SIGNDOC_TRUE).

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
Returns
SIGNDOC_TRUE if any attribute is set, SIGNDOC_FALSE if no attributes are set.
See also
SIGNDOC_TextFieldAttributes_isValid()
SIGNDOC_Boolean SIGNDOC_TextFieldAttributes_isValid ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_TextFieldAttributes aObj 
)

Check if the text field attributes are valid.

This function does not check if the font name refers to a valid font. This function does not check the string set by SIGNDOC_TextFieldAttributes_setRest().

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
Returns
SIGNDOC_TRUE if SIGNDOC_TextFieldAttributes_isSet() would return SIGNDOC_FALSE or if all attributes are set and are valid, SIGNDOC_FALSE otherwise.
See also
SIGNDOC_TextFieldAttributes_isSet(), SIGNDOC_TextFieldAttributes_setRest()
struct SIGNDOC_TextFieldAttributes * SIGNDOC_TextFieldAttributes_new ( struct SIGNDOC_Exception **  aEx)

SIGNDOC_TextFieldAttributes constructor.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
void SIGNDOC_TextFieldAttributes_setFontName ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj,
int  aEncoding,
const char *  aFontName 
)

Set the name of the font.

The font name can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file.

SIGNDOC_Document_addSignature() ignores the font name set by this function if string parameter "FontName" of struct SIGNDOC_SignatureParameters is set to a non-empty value or if the "SignatureTemplate" element of the XML document given to blob parameter "Template" has a non-empty "font-name" attribute.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aEncodingThe encoding of aFontName (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
[in]aFontNameThe new font name.
See also
SIGNDOC_TextFieldAttributes_getFontName(), SIGNDOC_TextFieldAttributes_setFontSize(), SIGNDOC_TextFieldAttributes_setTextColor(), SIGNDOC_DocumentLoader_loadFontConfigBlob(), SIGNDOC_DocumentLoader_loadFontConfigEnvironment(), SIGNDOC_DocumentLoader_loadFontConfigFile(), SIGNDOC_DocumentLoader_loadFontConfigStream()
void SIGNDOC_TextFieldAttributes_setFontSize ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj,
double  aFontSize 
)

Set the font size.

SIGNDOC_Document_addSignature() ignores the font size set by this function and uses length parameter "FontSize" of struct SIGNDOC_SignatureParameters instead.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aFontSizeThe font size (in user space units). If the font size is 0, the default font size (which depends on the field size) will be used.
See also
SIGNDOC_TextFieldAttributes_getFontSize(), SIGNDOC_TextFieldAttributes_setFontName(), SIGNDOC_DOCUMENT_SETFIELDFLAGS_FIT_HEIGHT_ONLY
void SIGNDOC_TextFieldAttributes_setRest ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj,
int  aEncoding,
const char *  aInput 
)

Set unparsed parts of default appearance string.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aEncodingThe encoding of aInput (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
[in]aInputThe new string of unparsed operators. If this string is non-empty and does not start with a space character, a space character will be prepended automatically.
void SIGNDOC_TextFieldAttributes_setTextColor ( struct SIGNDOC_Exception **  aEx,
struct SIGNDOC_TextFieldAttributes aObj,
const struct SIGNDOC_Color aTextColor 
)

Set the text color.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_TextFieldAttributes object.
[in]aTextColorThe text color.

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