Reference Guide
GdPicture14 Namespace / GdPicturePDF Class / GetStat Method
Example





In This Topic
    GetStat Method (GdPicturePDF)
    In This Topic
    Returns the status of the last executed operation with the current GdPicturePDF object.
    Syntax
    'Declaration
     
    
    Public Function GetStat() As GdPictureStatus
    public GdPictureStatus GetStat()
    public function GetStat(): GdPictureStatus; 
    public function GetStat() : GdPictureStatus;
    public: GdPictureStatus GetStat(); 
    public:
    GdPictureStatus GetStat(); 

    Return Value

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

    We strongly recommend always checking this status first.

    Remarks
    Use this method in the combination with all those, which return a value instead of a status, such as the PrintDialog method in the example below.
    Example
    How to find out if the PDF document has been printed successfully.
    Using oGdPicturePDF As New GdPicturePDF()
        If oGdPicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
            If oGdPicturePDF.PrintDialog() Then
                MessageBox.Show("The PDF document has been successfully printed.", "Example: GetStat")
            Else
                'Use the GetStat() method here to find the reason for the failure.
                MessageBox.Show("The PDF document has not been printed. Status: " + oGdPicturePDF.GetStat().ToString(), "Example: GetStat")
            End If
        Else
            MessageBox.Show("The file can't be opened.", "Example: GetStat")
        End If
    End Using
    using (GdPicturePDF oGdPicturePDF = new GdPicturePDF())
    {
        if (oGdPicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
        {
            if (oGdPicturePDF.PrintDialog())
            {
                MessageBox.Show("The PDF document has been successfully printed.", "Example: GetStat");
            }
            else
            {
                //Use the GetStat() method here to find the reason for the failure.
                MessageBox.Show("The PDF document has not been printed. Status: " + oGdPicturePDF.GetStat().ToString(), "Example: GetStat");
            }
        }
        else
        {
            MessageBox.Show("The file can't be opened.", "Example: GetStat");
        }
    }
    See Also