GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / SetSignaturePos Method
The horizontal (X) coordinate of the bottom left point of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method with respect to the currently defined origin, related to the current page.
The vertical (Y) coordinate of the bottom left point of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method with respect to the currently defined origin, related to the current page.
The width of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method. If you set the width to 0, the signature becomes invisible.
The height of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method. If you set the height to 0, the signature becomes invisible.
Example





In This Topic
SetSignaturePos Method (GdPicturePDF)
In This Topic
Sets up the coordinates and dimensions of the signature's bounding box within the current page of the loaded PDF document. This is the location, where the signature is placed after the successful signing of the current document. If you omit this method in the signing process, or you set the width or the height to 0, the signature will not be drawn, that means it becomes invisible on the current page.
Syntax
'Declaration
 
Public Function SetSignaturePos( _
   ByVal StampLeft As Single, _
   ByVal StampBottom As Single, _
   ByVal StampWidth As Single, _
   ByVal StampHeight As Single _
) As GdPictureStatus
public GdPictureStatus SetSignaturePos( 
   float StampLeft,
   float StampBottom,
   float StampWidth,
   float StampHeight
)
public function SetSignaturePos( 
    StampLeft: Single;
    StampBottom: Single;
    StampWidth: Single;
    StampHeight: Single
): GdPictureStatus; 
public function SetSignaturePos( 
   StampLeft : float,
   StampBottom : float,
   StampWidth : float,
   StampHeight : float
) : GdPictureStatus;
public: GdPictureStatus SetSignaturePos( 
   float StampLeft,
   float StampBottom,
   float StampWidth,
   float StampHeight
) 
public:
GdPictureStatus SetSignaturePos( 
   float StampLeft,
   float StampBottom,
   float StampWidth,
   float StampHeight
) 

Parameters

StampLeft
The horizontal (X) coordinate of the bottom left point of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method with respect to the currently defined origin, related to the current page.
StampBottom
The vertical (Y) coordinate of the bottom left point of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method with respect to the currently defined origin, related to the current page.
StampWidth
The width of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method. If you set the width to 0, the signature becomes invisible.
StampHeight
The height of the signature's bounding box, expressed in the current units specified by the SetMeasurementUnit method. If you set the height to 0, the signature becomes invisible.

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.

Be aware that the values of the coordinates and dimensions are expressed in the current units defined by the GdPicturePDF.SetMeasurementUnit method according to the current coordinate space defined by the GdPicturePDF.SetOrigin method. The signature is not drawn, if the width or the height of the specified bounding box are set to 0 or if this method is omitted in the signing process.

This method requires the Digital Signatures component to run.

Example
How to set the signature's location on the current page. You can find the complete sample within the ApplySignature() method's example.
Dim caption As String = "SetSignaturePos"
Dim gdpicturePDF As New GdPicturePDF()
            
'Please load the PDF document you want to sign.
            
'Please set the corresponding certificate - this is a mandatory step.
            
'Setting the origin for easier positioning the signature on the page.
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
            
'Set the signature's location on the current page. This step is optional.
'If this step is omitted, the signature will be invisible.
status = gdpicturePDF.SetSignaturePos(200, 500, 200, 100)
If status <> GdPictureStatus.OK Then
    MessageBox.Show("The method SetSignaturePos() 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 = "SetSignaturePos";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
            
//Please load the PDF document you want to sign.
            
//Please set the corresponding certificate - this is a mandatory step.
            
//Setting the origin for easier positioning the signature on the page.
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
            
//Set the signature's location on the current page. This step is optional.
//If this step is omitted, the signature will be invisible.
status = gdpicturePDF.SetSignaturePos(200, 500, 200, 100);
if (status != GdPictureStatus.OK)
{
    MessageBox.Show("The method SetSignaturePos() 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