---
title: "C# PDF/A validation: Validate conformance of PDF/A files | Nutrient .NET SDK"
canonical_url: "https://www.nutrient.io/guides/dotnet/pdfa/validate/"
md_url: "https://www.nutrient.io/guides/dotnet/pdfa/validate.md"
last_updated: "2026-05-21T17:12:02.215Z"
description: "Learn how to validate PDF/A compliance in C# using Nutrient .NET SDK. Verify that your PDF documents adhere to the PDF/A standard for archiving."
---

# Validate PDF/A in C#

PDF/A documents are intended for long-term preservation, and their structure follows clear requirements. To determine if these structural requirements are met, validate the PDF/A document.

## Validating a PDF/A document

To validate if a document is PDF/A-compliant, follow the steps below:

1. Create a `GdPicturePDF` object.

2. Load the source document by passing its path to the `LoadFromFile` method.

3. Validate the document by calling the `IsValidPDFA` method.

4. Write the output to the console.

5. Release unnecessary resources by calling the `CloseDocument` method.

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
// Load the source document.
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Validate the document.
bool isValid = gdpicturePDF.IsValidPDFA();
// Write the output to the console.
Console.WriteLine(isValid);
// Release unnecessary resources.
gdpicturePDF.CloseDocument();

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    ' Load the source document.
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Validate the document.
    Dim isValid As Boolean = gdpicturePDF.IsValidPDFA()
    ' Write the output to the console.
    Console.WriteLine(isValid)
    ' Release unnecessary resources.
    gdpicturePDF.CloseDocument()
End Using

```

#### Used methods

- [`CloseDocument`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~CloseDocument.html)

- [`IsValidPDFA`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~IsValidPDFA.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Validating a PDF/A document with detailed XML output

To validate if a document is PDF/A-compliant and receive all the validation details in XML format, follow these steps:

1. Create a `GdPicturePDF` object.

2. Load the source document by passing its path to the `LoadFromFile` method.

3. Create an empty string and an empty Boolean to store the validation results.

4. Validate the document by passing the empty string and the empty Boolean as reference parameters to the `IsValidPDFA` method.

5. Write the output to the console.

6. Release unnecessary resources by calling the `CloseDocument` method.

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
// Load the source document.
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Create an empty string and an empty Boolean to store the validation results.
string report = "";
PdfValidationConformance conformance = new();
// Validate the document.
gdpicturePDF.IsValidPDFA(ref report, ref conformance);
// Write the output to the console.
string output = $"Verified Conformance:\n{conformance}\nValidation Report:\n{report}";
Console.WriteLine(output);
// Release unnecessary resources.
gdpicturePDF.CloseDocument();

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    ' Load the source document.
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Create an empty string and an empty Boolean to store the validation results.
    Dim report = ""
    Dim conformance As PdfValidationConformance = New PdfValidationConformance()
    ' Validate the document.
    gdpicturePDF.IsValidPDFA(report, conformance)
    ' Write the output to the console.
    Dim output = $"Verified Conformance:
        {conformance}
        Validation Report:
        {report}"
    Console.WriteLine(output)
    ' Release unnecessary resources.
    gdpicturePDF.CloseDocument()
End Using

```

#### Used methods

- [`CloseDocument`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~CloseDocument.html)

- [`IsValidPDFA`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~IsValidPDFA.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

## Validating a PDF/A document with detailed JSON output

To validate if a document is PDF/A-compliant and receive all the validation details in JSON format, follow the steps below:

1. Create a `GdPicturePDF` object.

2. Load the source document by passing its path to the `LoadFromFile` method.

3. Create an empty string and an empty Boolean to store the validation results.

4. Validate the document by passing the empty string and the empty Boolean as reference parameters to the `IsValidPDFA` method.

5. Convert the validation report to JSON format with the `XmlDocument` class.

6. Write the output to the console.

7. Release unnecessary resources by calling the `CloseDocument` method.

### C#

```csharp

using GdPicturePDF gdpicturePDF = new GdPicturePDF();
// Load the source document.
gdpicturePDF.LoadFromFile(@"C:\temp\source.pdf");
// Create an empty string and an empty Boolean to store the validation results.
string report = "";
PdfValidationConformance conformance = new();
// Validate the document.
gdpicturePDF.IsValidPDFA(ref report, ref conformance);
// Convert the validation report to JSON format.
XmlDocument xmlDocument = new();
xmlDocument.LoadXml(report);
report = JsonConvert.SerializeXmlNode(xmlDocument);
// Write the output to the console.
string output = $"Verified Conformance:\n{conformance}\nValidation Report:\n{report}";
Console.WriteLine(output);
// Release unnecessary resources.
gdpicturePDF.CloseDocument();

```

### VB.NET

```vb

Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
    ' Load the source document.
    gdpicturePDF.LoadFromFile("C:\temp\source.pdf")
    ' Create an empty string and an empty Boolean to store the validation results.
    Dim report = ""
    Dim conformance As PdfValidationConformance = New PdfValidationConformance()
    ' Validate the document.
    gdpicturePDF.IsValidPDFA(report, conformance)
    ' Convert the validation report to JSON format.
    Dim xmlDocument As XmlDocument = New XmlDocument()
    xmlDocument.LoadXml(report)
    report = JsonConvert.SerializeXmlNode(xmlDocument)
    ' Write the output to the console.
    Dim output = $"Verified Conformance:
        {conformance}
        Validation Report:
        {report}"
    Console.WriteLine(output)
    ' Release unnecessary resources.
    gdpicturePDF.CloseDocument()
End Using

```

#### Used methods

- [`CloseDocument`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~CloseDocument.html)

- [`IsValidPDFA`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~IsValidPDFA.html)

- [`LoadFromFile`](/api/gdpicture/GdPicture.NET.14.API~GdPicture14.GdPicturePDF~LoadFromFile.html)

#### Related topics

- [Load a file](/guides/dotnet/load-a-file.md)

- [Save a file](/guides/dotnet/save-a-file.md)

---

## Related pages

- [C# PDF/A converter library](/guides/dotnet/pdfa.md)
- [Convert PDF to PDF/A documents in C#](/guides/dotnet/pdfa/convert.md)

