Skip to content

A Java CLI application to validate and report accessibility issues in PDF documents

Notifications You must be signed in to change notification settings

pdfix/action-validate-pdf-pdfix-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Accessibility Validator using PDFix

A Java CLI tool for validating the compliance of PDF documents with accessibility standards such as WCAG, or PDF/UA.

Introduction

This tool validates PDF accessibility by checking for issues in tagged PDF documents. It leverages the PDFix SDK (free version) for reading and processing PDF files. Ensuring that PDFs are accessible is crucial for users with disabilities, and this tool helps identify and report potential issues.

Table of Contents

Command-Line Options

Usage:
  java -jar validate-pdf-{version}.jar [operation] [arguments]

Operations:
  duplicate-mcid    : Check for and report duplicate MCID (Marked Content Identifier) entries in a tagged PDF.

Arguments:
  -i <file>         : Path to a single PDF file to validate.
  -d <folder>       : Path to a directory of PDF files to validate (will process all PDFs in the folder).

Run the CLI Commands

Report Duplicate MCID in Tagged PDF

This command validates a PDF file for duplicate MCID entries, which can cause accessibility issues for screen readers.

java -jar target/net.pdfix.validate-pdf-{version}.jar duplicate-mcid -i "path/to/your/file.pdf"

Output

===============================================================================
File: path/to/your/file.pdf
Duplicate MCID Found:
  MCID      : 9
  Page      : 26
  Index     : 32
  Type      : text
  BBox      : [240.12, 455.95, 297.72, 457.32]
  Content   : Friday

Total 1 duplicate MCID(s) found  
===============================================================================

Installation

You can download the pre-built jar from the Releases page if you prefer not to build the tool yourself.

Build Instructions

1. Download and Install PDFix SDK for Java

Before building the project, you need to download and install the PDFix SDK. This SDK is used to read and process PDF files for accessibility validation. Run the following commands:

mkdir -p lib
curl -L https://github.com/pdfix/pdfix_sdk_builds/releases/download/v8.4.3/java8-net.pdfix.pdfixlib-8.4.3.jar.zip -o lib/pdfixlib-8.4.3.jar.zip
unzip lib/pdfixlib-8.4.3.jar.zip -d lib/
mvn install:install-file -Dfile=lib/net.pdfix.pdfixlib-8.4.3.jar -DgroupId=net.pdfix -DartifactId=net.pdfix.pdfixlib -Dversion=8.4.3 -Dpackaging=jar

2. Compile, Test and Package

mvn compile
mvn test
mvn package

License

This project is licensed under the PDFix Free License.

Have a question? Need help?

If you have any questions or need assistance, feel free to reach out to us via email at support@pdfix.net.

About

A Java CLI application to validate and report accessibility issues in PDF documents

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages