SetSignatureText(String,String,Single,Byte,Byte,Byte,Byte,TextAlignment,TextAlignment,Boolean) Method
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 image will not be drawn.
This method uses the CMYK color space for specifying the required color.
'Declaration
Public Overloads Function SetSignatureText( _
ByVal As String, _
ByVal As String, _
ByVal As Single, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As Byte, _
ByVal As TextAlignment, _
ByVal As TextAlignment, _
ByVal As Boolean _
) As GdPictureStatus
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.
- 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.
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();