GithubHelp home page GithubHelp logo

wbz-hot / pdfavalidatorapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codeuctivity/pdfavalidatorapi

0.0 1.0 0.0 97.75 MB

PdfAValidatorApi wraps calls to VeraPdf in a .net standard assembly and as WebApi. Access VeraPdf from your Unittests or integrate it into your micorarchitecture.

License: GNU Affero General Public License v3.0

C# 99.81% Batchfile 0.09% Shell 0.10%

pdfavalidatorapi's Introduction

PdfAValidatorApi

Codacy Badge Build status Nuget Build status Donate

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");
}

Demo OpenApi - PdfAValidatorWebApi

Give https://pdfavalidator.azurewebsites.net a try, but dont be disappointed if it is offline. The demo azure account is running on limited budget.

Dependencies

Windows

Everything comes with the nuget package

Ubuntu 20.04

Current PdfAValidatorApi depends on opnejdf-8-jre and .net core 3.1.

sudo apt install openjdk-8-jre
sudo update-alternatives --config java

Additional things for developing this package

Setup .net sdk

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

pdfavalidatorapi's People

Contributors

codacy-badger avatar ra-magnus-welander avatar seeste avatar stesee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.