PdfAValidatorApi wraps calls to VeraPdf in a .net standard assembly and as WebApi. Access VeraPdf from your unit tests or integrate it into your micro architecture.
Install it using nuget package PdfAValidatorApi:
dotnet add package PdfAValidator
Sample - e.g. use it in your unit test to check compliance of some pdf:
public static async Task ShouldDetectCompliantPdfA()
{
using var pdfAValidator = new PdfAValidator();
Assert.True(File.Exists("./TestPdfFiles/FromLibreOffice.pdf"));
var result = await pdfAValidator.ValidateAsync("./TestPdfFiles/FromLibreOffice.pdf");
Assert.True(result);
}
Sample - e.g. use it in your unit test to check the used sub standard of some pdf:
public static async Task ShouldGetDetailedReportFromPdfA()
{
using var pdfAValidator = new PdfAValidator();
Assert.True(File.Exists("./TestPdfFiles/FromLibreOffice.pdf"));
var result = await pdfAValidator.ValidateWithDetailedReportAsync("./TestPdfFiles/FromLibreOffice.pdf");
Assert.True(result.Jobs.Job.ValidationReport.IsCompliant);
Assert.True(result.Jobs.Job.ValidationReport.ProfileName == "PDF/A-1A validation profile");
}
Give https://pdfavalidator.azurewebsites.net a try, but dont be disappointed if it is offline. The demo azure account is running on limited budget.
Everything comes with the nuget package
Current PdfAValidatorApi depends on opnejdf-8-jre and .net core 3.1.
sudo apt install openjdk-8-jre
sudo update-alternatives --config java
Based on https://docs.microsoft.com/de-de/dotnet/core/install/linux-package-manager-ubuntu-2004
sudo snap remove dotnet-sdk
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1