GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / IsValidPDFA Method / IsValidPDFA() Method
Example





In This Topic
IsValidPDFA() Method
In This Topic
Validates if the currently loaded PDF document conforms to PDF/A standard it claims.
Syntax
'Declaration
 
Public Overloads Function IsValidPDFA() As Boolean
public bool IsValidPDFA()
public function IsValidPDFA(): Boolean; 
public function IsValidPDFA() : boolean;
public: bool IsValidPDFA(); 
public:
bool IsValidPDFA(); 

Return Value

true if currently loaded document is Valid PDF/A document, otherwise returns false. The GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Example
How to check if document is valid PDF/A document.
Dim caption As String = "Example: IsValidPDFA"
Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
    If status = GdPictureStatus.OK Then
        Dim IsValid As Boolean = gdpicturePDF.IsValidPDFA()
        status = gdpicturePDF.GetStat()
        If status = GdPictureStatus.OK Then
            If IsValid Then
                MessageBox.Show("The PDF document is a Valid PDF/A Document.", caption)
            Else
                MessageBox.Show("The PDF document is not a Valid PDF/A Document.", caption)
            End If
        Else
            MessageBox.Show("Error occurred durring the document validation process. Status: " + status.ToString(), caption)
        End If
    Else
        MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), caption)
    End If
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    string caption = "Example: IsValidPDFA";
    GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
    if (status == GdPictureStatus.OK)
    {
        bool isValid = gdpicturePDF.IsValidPDFA();
        status = gdpicturePDF.GetStat();
        if (status == GdPictureStatus.OK)
        {
            if(isValid)
            {
                MessageBox.Show("The PDF document is a Valid PDF/A Document.", caption);
            }
            else
            {
                MessageBox.Show("The PDF document is not a Valid PDF/A Document.", caption);
            }
        }
        else
        {
            MessageBox.Show("Error occurred durring the document validation process. Status: " + status.ToString(), caption);
        }
    }
    else
    {
        MessageBox.Show("The file can't be loaded. Status: " + status.ToString(), caption);
    }
}
See Also