GetDataAsRTF

Description

Retrieves the text data in the control as an RTF ANSI text block in a blob or Unicode string. This function does not return graphic data.

Applies to

Signature controls

Syntax

Integer controlname.GetDataAsRTF ( data )

Argument

Description

controlname

The name of the control for which you want to retrieve the data

data

The blob or string in which the RTF data is saved

Returns

Integer. Returns 1 for success and a negative integer for failure.

Usage

The GetDataAsRTF function returns text data from a Signature control in PWI format in a blob or a Unicode string. Only text data, such as text entered using the SIP, is retrieved.

Examples

Example 1

The following example gets text data from a Signature control in RTF format as a blob and as a string and writes the RTF to two separate files:

blob lblb_rtf
string ls_rtf
integer li_file, li_rtn

// Get data as a blob
li_rtn = sig_1.GetDataAsRTF(lblb_rtf)
sle_1.text = string(li_rtn)

li_file = FileOpen("\My Documents\blob.rtf",   &
   StreamMode!, Write!, LockWrite!, Replace!)
FileWrite( li_file, lblb_rtf )
FileClose( li_file )

// Get data as a string
li_rtn = sig_1.GetDataAsRTF(ls_rtf)
sle_1.text += ", " + String(li_rtn)

li_file = FileOpen("\My Documents\string.rtf",  &
   StreamMode!, Write!, LockWrite!, Replace!)
FileWrite( li_file, ls_rtf )
FileClose( li_file )

See also