GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / SetSignatureText Method / SetSignatureText(String,String,Single,Byte,Byte,Byte,Byte,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 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.
The amount of cyan color to be used for the resulting text color. Use the value between 0 and 255.
The amount of magenta color to be used for the resulting text color. Use the value between 0 and 255.
The amount of yellow color to be used for the resulting text color. Use the value between 0 and 255.
The amount of black color to be used for the resulting text color. Use the value between 0 and 255.
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,Byte,Byte,Byte,Byte,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 SetSignatureStampImage method, the text will be situated on the left side within the signature's bounding box. If the applied signature is invisible, the image will not be drawn.

This method uses the CMYK color space for specifying the required color.

Syntax
'Declaration
 
Public Overloads Function SetSignatureText( _
   ByVal Text As String, _
   ByVal FontResName As String, _
   ByVal FontSize As Single, _
   ByVal Cyan As Byte, _
   ByVal Magenta As Byte, _
   ByVal Yellow As Byte, _
   ByVal Black As Byte, _
   ByVal AlignHorz As TextAlignment, _
   ByVal AlignVert As TextAlignment, _
   ByVal ShowText As Boolean _
) As GdPictureStatus
public GdPictureStatus SetSignatureText( 
   string Text,
   string FontResName,
   float FontSize,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black,
   TextAlignment AlignHorz,
   TextAlignment AlignVert,
   bool ShowText
)
public function SetSignatureText( 
    Text: String;
    FontResName: String;
    FontSize: Single;
    Cyan: Byte;
    Magenta: Byte;
    Yellow: Byte;
    Black: Byte;
    AlignHorz: TextAlignment;
    AlignVert: TextAlignment;
    ShowText: Boolean
): GdPictureStatus; 
public function SetSignatureText( 
   Text : String,
   FontResName : String,
   FontSize : float,
   Cyan : byte,
   Magenta : byte,
   Yellow : byte,
   Black : byte,
   AlignHorz : TextAlignment,
   AlignVert : TextAlignment,
   ShowText : boolean
) : GdPictureStatus;
public: GdPictureStatus SetSignatureText( 
   string* Text,
   string* FontResName,
   float FontSize,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black,
   TextAlignment AlignHorz,
   TextAlignment AlignVert,
   bool ShowText
) 
public:
GdPictureStatus SetSignatureText( 
   String^ Text,
   String^ FontResName,
   float FontSize,
   byte Cyan,
   byte Magenta,
   byte Yellow,
   byte Black,
   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 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.
Cyan
The amount of cyan color to be used for the resulting text color. Use the value between 0 and 255.
Magenta
The amount of magenta color to be used for the resulting text color. Use the value between 0 and 255.
Yellow
The amount of yellow color to be used for the resulting text color. Use the value between 0 and 255.
Black
The amount of black color to be used for the resulting text color. Use the value between 0 and 255.
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, 255, 255, 128, 128, 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, 255, 255, 128, 128, 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