GdPicture.NET.14.API
GdPicture14 Namespace / GdPicturePDF Class / IsValidPDFA Method / IsValidPDFA(String,PdfValidationConformance) Method
Output parameter. Provides detailed validation result in machine readable XML report. If the file does not conform to the requested standard the XML report will summarize all problems that have been found durring the validation process.
Output parameter. A member of the PdfValidationConformance enumeration. Provides information about the claimed conformance that the document was validated against.
Example





In This Topic
IsValidPDFA(String,PdfValidationConformance) Method
In This Topic
Validates if the currently loaded PDF document conforms to PDF/A standard it claims.
Syntax
'Declaration
 
Public Overloads Function IsValidPDFA( _
   ByRef DetailedXMLOutput As String, _
   ByRef VerifiedConformance As PdfValidationConformance _
) As Boolean
public bool IsValidPDFA( 
   ref string DetailedXMLOutput,
   ref PdfValidationConformance VerifiedConformance
)
public function IsValidPDFA( 
   var  DetailedXMLOutput: String;
   var  VerifiedConformance: PdfValidationConformance
): Boolean; 
public function IsValidPDFA( 
   DetailedXMLOutput : String,
   VerifiedConformance : PdfValidationConformance
) : boolean;
public: bool IsValidPDFA( 
   ref string* DetailedXMLOutput,
   ref PdfValidationConformance VerifiedConformance
) 
public:
bool IsValidPDFA( 
   String^% DetailedXMLOutput,
   PdfValidationConformance% VerifiedConformance
) 

Parameters

DetailedXMLOutput
Output parameter. Provides detailed validation result in machine readable XML report. If the file does not conform to the requested standard the XML report will summarize all problems that have been found durring the validation process.
VerifiedConformance
Output parameter. A member of the PdfValidationConformance enumeration. Provides information about the claimed conformance that the document was validated against.

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 XMLReport As String = String.Empty
        Dim VerifiedConformance As PdfValidationConformance
        Dim IsValid As Boolean = gdpicturePDF.IsValidPDFA(XMLReport, VerifiedConformance)
        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. Refer to the XML Report for further details.", 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)
    {
        string XMLReport = string.Empty;
        bool verifiedConformance;
        bool isValid = gdpicturePDF.IsValidPDFA(ref XMLReport, ref verifiedConformance);
        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. Refer to the XML Report for further details.", 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