VerifyDocument(PdfDocumentConformance) Method (PdfDocument)
Verifies the PDF document to conformance with the specified format.
Parameters
- documentConformance
- The PDF document conformance.
Return Value
True if verification is passed successfully; otherwise, false.
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.
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.");
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5