GetPDFAConformance Method (GdPicturePDF)
In This Topic
Returns the PDF or PDF/A conformance of the currently loaded PDF document.
PDF/A is an ISO-standardized version of the PDF specialized for the digital preservation of electronic documents. It is a subset of the PDF standard which excludes those PDF features that give rise to concerns about security and the ability to archive documents long term.
Syntax
Return Value
A member of the PdfConformance enumeration. Returns standard PDF/A conformance levels and versions for the PDF/A compliant document. The
GdPicturePDF.GetStat method can be subsequently used to determine if this method has been successful.
Example
How to determine the conformance to the PDF/A standard of the PDF document.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("your_test_pdfa.pdf", False)
If status = GdPictureStatus.OK Then
Dim oConformance As PdfConformance = gdpicturePDF.GetPDFAConformance()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance")
Else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetPDFAConformance")
End If
If gdpicturePDF.CloseDocument() <> GdPictureStatus.OK Then
Return
End If
If gdpicturePDF.NewPDF(PdfConformance.PDF_A_1b) = GdPictureStatus.OK Then
Dim oConformance As PdfConformance = gdpicturePDF.GetPDFAConformance()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance") 'Should be PDF_A_1b.
Else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance")
End If
Else
MessageBox.Show("The new file can't be created.", "Example: GetPDFAConformance")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("your_test_pdfa.pdf", false);
if (status == GdPictureStatus.OK)
{
PdfConformance oConformance = gdpicturePDF.GetPDFAConformance();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance");
else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance");
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetPDFAConformance");
}
if (gdpicturePDF.CloseDocument() != GdPictureStatus.OK)
return;
if (gdpicturePDF.NewPDF(PdfConformance.PDF_A_1b) == GdPictureStatus.OK)
{
PdfConformance oConformance = gdpicturePDF.GetPDFAConformance();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance"); //Should be PDF_A_1b.
else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance");
}
else
{
MessageBox.Show("The new file can't be created.", "Example: GetPDFAConformance");
}
gdpicturePDF.Dispose();
Example
How to determine the conformance to the PDF/A standard of the PDF document.
Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("your_test_pdfa.pdf", False)
If status = GdPictureStatus.OK Then
Dim oConformance As PdfConformance = gdpicturePDF.GetPDFAConformance()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance")
Else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: GetPDFAConformance")
End If
If gdpicturePDF.CloseDocument() <> GdPictureStatus.OK Then
Return
End If
If gdpicturePDF.NewPDF(PdfConformance.PDF_A_1b) = GdPictureStatus.OK Then
Dim oConformance As PdfConformance = gdpicturePDF.GetPDFAConformance()
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance") 'Should be PDF_A_1b.
Else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance")
End If
Else
MessageBox.Show("The new file can't be created.", "Example: GetPDFAConformance")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("your_test_pdfa.pdf", false);
if (status == GdPictureStatus.OK)
{
PdfConformance oConformance = gdpicturePDF.GetPDFAConformance();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance");
else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance");
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: GetPDFAConformance");
}
if (gdpicturePDF.CloseDocument() != GdPictureStatus.OK)
return;
if (gdpicturePDF.NewPDF(PdfConformance.PDF_A_1b) == GdPictureStatus.OK)
{
PdfConformance oConformance = gdpicturePDF.GetPDFAConformance();
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
MessageBox.Show("This PDF conforms to " + oConformance.ToString() + " standard.", "Example: GetPDFAConformance"); //Should be PDF_A_1b.
else
MessageBox.Show("The GetPDFAConformance() method has failed with the status: " + status.ToString(), "Example: GetPDFAConformance");
}
else
{
MessageBox.Show("The new file can't be created.", "Example: GetPDFAConformance");
}
gdpicturePDF.Dispose();
See Also