How to test if a PDF is compatible with the PDF/A standard in C# using PDF Extractor SDK - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

How to test if a PDF is compatible with the PDF/A standard in C# using PDF Extractor SDK

  • Home
  • /
  • Articles
  • /
  • How to test if a PDF is compatible with the PDF/A standard in C# using PDF Extractor SDK

The sample below shows how to test if a PDF document is compatible with the PDF/A standard in C# using PDF Extractor SDK.

PDF-A Compatibility Test in C#

using System;
using Bytescout.PDFExtractor;

namespace PDFATest
{
	class Program
	{
		static void Main(string[] args)
		{
			// Create Bytescout.PDFExtractor.PDFAValidator instance
			PDFAValidator validator = new PDFAValidator();
			validator.RegistrationName ="demo";
			validator.RegistrationKey = "demo";

			// Load sample PDF document
			validator.LoadDocumentFromFile("good0016.pdf");
			
			if (validator.IsPDFA)
				Console.WriteLine("This file conforms to the PDF/A standard");
			else
				Console.WriteLine("This file doesn't conform to the PDF/A standard. Check .ValidationErros for the list of errors");

			Console.WriteLine();
			Console.WriteLine("Press any key to continue...");
			Console.ReadLine();
		}
	}
}

Tutorials:

prev
next