Skip to content

groupdocs-metadata/pdfa-conformance-detection-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Detect PDF/A Conformance using GroupDocs.Metadata for .NET

Product Page Docs Blog Free Support Temporary License

🚀 Quick Start

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.

✨ What You'll Learn

  • How to load a PDF file with the Metadata API
  • 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

📋 Table of Contents

📖 About This Repository

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.

🔑 Key Features

GroupDocs.Metadata Capabilities

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.

What This Repository Demonstrates

  • Detecting PDF/A conformance and identifying the exact PDF/A version.
  • Accessing the root package of a PDF through the PdfRootPackage class.
  • Using the FileType.IsPdfA property to verify archival compliance.
  • Handling both compliant and non‑compliant documents in a clean, readable way.

⚙️ Prerequisites

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.

📁 Repository Structure

sample-project/
│
├── Program.cs

File Overview

  • Program.cs – Console application that loads a PDF, checks PDF/A compliance, and prints the detected version or a non‑compliance message.

💻 Implementation Examples

Example 1: Snippet: Detect PDF/A conformance and indicate the PDF/A version.

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 Metadata object with a file path.
  • Retrieval of the PDF's root package using the generic GetRootPackage<T>() method.
  • Checking the IsPdfA boolean 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.

📚 Related 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 PdfRootPackage and 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 →

🏷️ Keywords

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


About

GroupDocs.Metadata for .NET sample that checks whether a PDF complies with PDF/A standards and reports the exact PDF/A version.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages