IsValidPDFA(String) 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 As String _
) As Boolean
public bool IsValidPDFA(
ref string
)
public function IsValidPDFA(
var : String
): Boolean;
public function IsValidPDFA(
: String
) : boolean;
public: bool IsValidPDFA(
ref string*
)
public:
bool IsValidPDFA(
String^%
)
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.
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 IsValid As Boolean = gdpicturePDF.IsValidPDFA(XMLReport)
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 isValid = gdpicturePDF.IsValidPDFA(ref XMLReport);
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);
}
}
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 IsValid As Boolean = gdpicturePDF.IsValidPDFA(XMLReport)
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 isValid = gdpicturePDF.IsValidPDFA(ref XMLReport);
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