VintaSoft Imaging .NET SDK 15.1: Documentation for .NET developer
Vintasoft.Imaging.Pdf Namespace / PdfDocument Class / VerifyDocument Methods / VerifyDocument(PdfDocumentConformance) Method
Syntax Remarks Example Requirements SeeAlso
In This Topic
VerifyDocument(PdfDocumentConformance) Method (PdfDocument)
In This Topic
Verifies the PDF document to conformance with the specified format.
Syntax
'Declaration

Public Overloads Function VerifyDocument( _
ByVal documentConformance
The PDF document conformance.
As PdfDocumentConformance _
) As Boolean

Parameters

documentConformance
The PDF document conformance.

Return Value

True if verification is passed successfully; otherwise, false.
Remarks

The method supports only the following formats: PDF/A-1b, PDF/A-2b, PDF/A-3b, PDF/A-1a, PDF/A-2a, PDF/A-3a, PDF/A-2u, PDF/A-3u, PDF/A-4, PDF/A-4e, PDF/A-4f.

Example

Here is an example that shows how to verify a PDF document to conformance with PDF/A-1b specification:


''' <summary>
''' Verifies a PDF document to conformance with PDF/A-1b specification.
''' </summary>
''' <param name="pdfFilename">The filename of PDF document.</param>
Public Shared Sub VerifyDocumentToPdfA1b(pdfFilename As String)
    ' open PDF document
    Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename)
        ' verify that PDF document conforms PDF/A-1b and output the result

        System.Console.WriteLine("Verification...")
        If document.VerifyDocument(Vintasoft.Imaging.Pdf.PdfDocumentConformance.PdfA_1b) Then
            System.Console.WriteLine("Document conforms to PDF/A-1b.")
        Else
            System.Console.WriteLine("Document does not conform to PDF/A-1b.")
        End If
    End Using
End Sub


/// <summary>
/// Verifies a PDF document to conformance with PDF/A-1b specification.
/// </summary>
/// <param name="pdfFilename">The filename of PDF document.</param>
public static void VerifyDocumentToPdfA1b(string pdfFilename)
{
    // open PDF document
    using (Vintasoft.Imaging.Pdf.PdfDocument document = new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
    {
        // verify that PDF document conforms PDF/A-1b and output the result

        System.Console.WriteLine("Verification...");
        if (document.VerifyDocument(Vintasoft.Imaging.Pdf.PdfDocumentConformance.PdfA_1b))
            System.Console.WriteLine("Document conforms to PDF/A-1b.");
        else
            System.Console.WriteLine("Document does not conform to PDF/A-1b.");
    }
}

Requirements

Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

See Also