Get started with GroupDocs.Metadata for .NET to detect PDF/A conformance in your documents. This repository provides a ready‑to‑run console example that demonstrates how to read a PDF, check its PDF/A compliance, and output the exact PDF/A version. Perfect for developers who need to verify archival quality of PDF files programmatically.
- How to load a PDF file with the
MetadataAPI - How to access the root package and evaluate
FileType.IsPdfA - How to retrieve the specific PDF/A conformance level via
FileType.PdfFormat - How to handle non‑compliant PDFs gracefully
- How to integrate PDF/A validation into larger document‑processing pipelines
- Best practices for working with GroupDocs.Metadata in .NET projects
- About This Repository
- Key Features
- Prerequisites
- Repository Structure
- Implementation Examples
- Related Resources
- Keywords
This repository contains practical examples for implementing PDF/A conformance detection using GroupDocs.Metadata for .NET. GroupDocs.Metadata enables developers to read, modify, and validate metadata across a wide range of document formats, including PDF, Word, Excel, and more. These examples are designed for C# developers working with PDF/A archival documents who need to programmatically ensure compliance with ISO 19005 standards. Each example demonstrates real‑world scenarios and best practices for reliable metadata handling.
GroupDocs.Metadata provides powerful document processing capabilities:
| Feature | Description |
|---|---|
| Metadata Extraction | Retrieve structured metadata from over 100 file formats. |
| Metadata Modification | Edit, add, or remove metadata without altering document content. |
| Compliance Validation | Validate documents against standards such as PDF/A, ISO 19005, and more. |
| Secure Document Handling | Work with encrypted or password‑protected files safely. |
| Cross‑Platform Support | Available for .NET, Java, Python, and Node.js ecosystems. |
- Detecting PDF/A conformance and identifying the exact PDF/A version.
- Accessing the root package of a PDF through the
PdfRootPackageclass. - Using the
FileType.IsPdfAproperty to verify archival compliance. - Handling both compliant and non‑compliant documents in a clean, readable way.
Before you begin, ensure you have:
- .NET SDK – .NET 6.0 or later.
- GroupDocs.Metadata for .NET – Install via NuGet (
GroupDocs.Metadata). - Temporary License – Obtain a free temporary license from the link above.
sample-project/
│
├── Program.cs
- Program.cs – Console application that loads a PDF, checks PDF/A compliance, and prints the detected version or a non‑compliance message.
This example opens a PDF file, reads its root package, and determines whether the document conforms to PDF/A. If it does, the exact PDF/A version (e.g., PDF/A‑1b, PDF/A‑2u) is printed; otherwise, a message indicating non‑compliance is shown. The snippet demonstrates the core API calls Metadata, GetRootPackage<PdfRootPackage>(), and the FileType properties.
using (Metadata metadata = new Metadata(path))
{
var root = metadata.GetRootPackage<PdfRootPackage>();
if (root.FileType.IsPdfA)
{
}
else
{
}
}What This Example Shows:
- How to instantiate the
Metadataobject with a file path. - Retrieval of the PDF's root package using the generic
GetRootPackage<T>()method. - Checking the
IsPdfAboolean to quickly determine compliance. - Accessing
FileType.PdfFormat(inside the omitted block) to obtain the specific PDF/A version when compliant. - A clean, try‑with‑resources pattern (
using) that ensures proper disposal of resources.
Explore these additional resources to deepen your understanding of PDF/A validation and metadata handling:
-
PDF/A Validation with GroupDocs.Metadata – Step‑by‑step guide on verifying PDF/A compliance across different PDF/A levels: Read the article →
-
Working with PDF Root Packages – Learn how to navigate the PDF object model using
PdfRootPackageand other low‑level classes: Read the article → -
Extracting and Modifying Document Metadata – Comprehensive tutorial on reading, editing, and saving metadata for PDFs and other formats: Read the article →
GroupDocs.Metadata, .NET, PDF/A, metadata extraction, document compliance, PdfRootPackage, IsPdfA, PdfFormat, C#, metadata API, document validation, archival PDFs, ISO 19005, metadata handling, PDF processing, digital preservation, file type detection, metadata modification, security, cross‑platform, NuGet, temporary license
Need help? Get Free Support | Get Temporary License