GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / SetSignatureText Method / SetSignatureText(String,String,Single,GdPictureColor,TextAlignment,TextAlignment,Boolean) Method
The required text to draw. If you leave this parameter empty and the ShowText parameter is set to true, the drawn text will be built automatically using the additional information previously defined by the GdPicturePDF.SetSignatureInfo method. The text will not be drawn if the signature is invisible.
The resource name of the font you prefer for drawing the text. If you leave this parameter empty, the predefined standard font is used. For further assistance, please see the Fonts section of the GdPicturePDF class in the Reference Guide.
A text (font) size, in points. Please note that 1 point = 1/72 inch.
A color object that defines the color of the required text.
The required horizontal alignment of the text within the signature's bounding box.
The required vertical alignment of the text within the signature's bounding box.
Set this parameter to true, if you want to draw the text, otherwise set it to false.
Example





In This Topic
SetSignatureText(String,String,Single,GdPictureColor,TextAlignment,TextAlignment,Boolean) Method
In This Topic
Sets up the defined text to be displayed within the signature's bounding box according to the parameters you have specified. The required settings will be applied during the subsequent signing process. If you also set the image using the GdPicturePDF.SetSignatureStampImage method, the text will be situated on the left side within the signature's bounding box. If the applied signature is invisible, the text will not be drawn.
Syntax
'Declaration
 
Public Overloads Function SetSignatureText( _
   ByVal Text As String, _
   ByVal FontResName As String, _
   ByVal FontSize As Single, _
   ByVal Color As GdPictureColor, _
   ByVal AlignHorz As TextAlignment, _
   ByVal AlignVert As TextAlignment, _
   ByVal ShowText As Boolean _
) As GdPictureStatus
public function SetSignatureText( 
    Text: String;
    FontResName: String;
    FontSize: Single;
    Color: GdPictureColor;
    AlignHorz: TextAlignment;
    AlignVert: TextAlignment;
    ShowText: Boolean
): GdPictureStatus; 
public function SetSignatureText( 
   Text : String,
   FontResName : String,
   FontSize : float,
   Color : GdPictureColor,
   AlignHorz : TextAlignment,
   AlignVert : TextAlignment,
   ShowText : boolean
) : GdPictureStatus;
public: GdPictureStatus SetSignatureText( 
   string* Text,
   string* FontResName,
   float FontSize,
   GdPictureColor Color,
   TextAlignment AlignHorz,
   TextAlignment AlignVert,
   bool ShowText
) 
public:
GdPictureStatus SetSignatureText( 
   String^ Text,
   String^ FontResName,
   float FontSize,
   GdPictureColor Color,
   TextAlignment AlignHorz,
   TextAlignment AlignVert,
   bool ShowText
) 

Parameters

Text
The required text to draw. If you leave this parameter empty and the ShowText parameter is set to true, the drawn text will be built automatically using the additional information previously defined by the GdPicturePDF.SetSignatureInfo method. The text will not be drawn if the signature is invisible.
FontResName
The resource name of the font you prefer for drawing the text. If you leave this parameter empty, the predefined standard font is used. For further assistance, please see the Fonts section of the GdPicturePDF class in the Reference Guide.
FontSize
A text (font) size, in points. Please note that 1 point = 1/72 inch.
Color
A color object that defines the color of the required text.
AlignHorz
The required horizontal alignment of the text within the signature's bounding box.
AlignVert
The required vertical alignment of the text within the signature's bounding box.
ShowText
Set this parameter to true, if you want to draw the text, otherwise set it to false.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

Just to remind you that if you want to apply the defined settings during the signing, you need to set up the required parameters before you start the signing process. But using this method in the whole process is optional.

This method requires the Digital Signatures component to run.

Example
How to set up the additional text to be displayed within the signature. You can find the complete sample within the ApplySignature() method's example.
Dim caption As String = "SetSignatureText"
Dim gdpicturePDF As New GdPicturePDF()
            
'Please load the PDF document you want to sign.
            
'Please set the corresponding certificate - this is a mandatory step.
            
'Set the text to be displayed within the signature's bounding box. This step is optional.
Dim status As GdPictureStatus = gdpicturePDF.SetSignatureText("", "", 12, Color.Navy, TextAlignment.TextAlignmentCenter, TextAlignment.TextAlignmentCenter, True)
If status <> GdPictureStatus.OK Then
    MessageBox.Show("The method SetSignatureText() has failed with the status " + status.ToString(), caption)
    GoTo [error]
End If
            
'Please see the complete sample in the ApplySignature() method for next steps to follow.
            
[error]:
gdpicturePDF.Dispose()
string caption = "SetSignatureText";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
            
//Please load the PDF document you want to sign.
            
//Please set the corresponding certificate - this is a mandatory step.
            
//Set the text to be displayed within the signature's bounding box. This step is optional.
GdPictureStatus status = gdpicturePDF.SetSignatureText("", "", 12, Color.Navy, TextAlignment.TextAlignmentCenter, TextAlignment.TextAlignmentCenter, true);
if (status != GdPictureStatus.OK)
{
    MessageBox.Show("The method SetSignatureText() has failed with the status " + status.ToString(), caption);
    goto error;
}
            
//Please see the complete sample in the ApplySignature() method for next steps to follow.
            
error:
gdpicturePDF.Dispose();
See Also