GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / GetSignatureCount Method
Example





In This Topic
GetSignatureCount Method (GdPicturePDF)
In This Topic
Returns the number of applied digital signatures to the currently loaded PDF document.
Syntax
'Declaration
 
Public Function GetSignatureCount() As Integer
public int GetSignatureCount()
public function GetSignatureCount(): Integer; 
public function GetSignatureCount() : int;
public: int GetSignatureCount(); 
public:
int GetSignatureCount(); 

Return Value

The number of applied digital signatures. The GetStat method can be subsequently used to determine if this method has been successful.
Remarks
This method is only allowed for use with non-encrypted documents.

It is recommend to use the GetStat method to identify the specific reason for the method's failure, if any.

This method requires the Digital Signatures component to run.

Example
How to determine the number of applied digital signatures to the current document.
Dim caption As String = "GetSignatureCount"
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
    Dim signatureCount As Integer = gdpicturePDF.GetSignatureCount()
    status = gdpicturePDF.GetStat()
    If status = GdPictureStatus.OK Then
        MessageBox.Show("This PDF document contains " + signatureCount.ToString() + " digital signature/s.", caption)
    Else
        MessageBox.Show("The GetSignatureCount() method has failed with the status: " + status.ToString(), caption)
    End If
Else
    MessageBox.Show("The file can't be loaded.", caption)
End If
gdpicturePDF.Dispose()
string caption = "GetSignatureCount";
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
    int signatureCount = gdpicturePDF.GetSignatureCount();
    status = gdpicturePDF.GetStat();
    if (status == GdPictureStatus.OK)
        MessageBox.Show("This PDF document contains " + signatureCount.ToString() + " digital signature/s.", caption);
    else
        MessageBox.Show("The GetSignatureCount() method has failed with the status: " + status.ToString(), caption);
}
else
    MessageBox.Show("The file can't be loaded.", caption);
gdpicturePDF.Dispose();
See Also