Docotic.Pdf Library Help > Samples > General operations > Check if PDF document is a PDF/A compliant one

This sample shows how to check if PDF document is a PDF/A compliant one.

Use PdfDocument.GetPdfaConformance method to retrieve PDF/A standard conformance level for the document.

C#
using System.Windows.Forms;

using BitMiracle.Docotic.Pdf;

namespace BitMiracle.Docotic.Pdf.Samples
{
    public static class CheckConformanceToPdfA
    {
        public static void Main()
        {
            // NOTE: 
            // When used in trial mode, the library imposes some restrictions.
            // Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            // for more information.

            using (PdfDocument pdf = new PdfDocument(@"Sample Data\PDF-A.pdf"))
            {
                PdfaConformance level = pdf.GetPdfaConformance();
                MessageBox.Show("PDF/A conformance level: " + level);
            }
        }
    }
}
VB
Imports System.Windows.Forms

Imports BitMiracle.Docotic.Pdf

Namespace BitMiracle.Docotic.Pdf.Samples
    Public NotInheritable Class CheckConformanceToPdfA
        Public Shared Sub Main()
            ' NOTE: 
            ' When used in trial mode, the library imposes some restrictions.
            ' Please visit http://bitmiracle.com/pdf-library/trial-restrictions.aspx
            ' for more information.

            Using pdf As New PdfDocument("Sample Data\PDF-A.pdf")
                Dim level As PdfaConformance = pdf.GetPdfaConformance()
                MessageBox.Show("PDF/A conformance level: " + level.ToString())
            End Using
        End Sub
    End Class
End Namespace