Docker wrapper for verapdf PDF validation, designed for use with Quarto but usable standalone.
This PowerShell script runs verapdf through Docker, avoiding the need to install Java and verapdf directly on your system.
- Docker Desktop installed and running
- WSL distribution with Docker accessible
- PowerShell with a
dockerfunction/command that forwards to Docker (via WSL or Docker Desktop) - Internet connection (for first run to pull Docker image)
If you use the r-bucket Scoop bucket:
scoop install verapdf-dockerThis will:
- Install the wrapper script
- Create a
verapdf-dockercommand available on your PATH - Automatically set
QUARTO_VERAPDF=verapdf-dockerenvironment variable
- Download
verapdf-docker.ps1from this gist - Place it somewhere in your PATH
- Make it executable (PowerShell scripts are executable by default on Windows)
- For Quarto integration, set:
$env:QUARTO_VERAPDF = "verapdf-docker"
Once installed via Scoop, Quarto will automatically use the Docker-based verapdf for PDF validation.
In your .qmd file YAML front matter:
---
format:
pdf:
pdf-standard: ua-2 # or a-2b, ua-1, etc.
---Render your document:
quarto render document.qmdQuarto will use Docker verapdf for validation instead of the built-in Java-based verapdf.
You can also use the wrapper directly:
verapdf-docker -f ua2 document.pdf
verapdf-docker --help
verapdf-docker --version- Checks if Docker is available
- Converts Windows paths to Unix-style paths for Docker volume mounts
- Runs
verapdf/cli:latestDocker container with:- Current directory mounted as
/data - All arguments passed through to verapdf
- Current directory mounted as
- Returns verapdf's exit code
The script uses your existing docker command/function. If you have a custom Docker setup (e.g., Docker via WSL), the script will automatically use it.
Error: "Docker is not running"
- Start Docker Desktop
- Wait for Docker to fully initialize
- Verify with:
docker version
Error: "Unable to find image 'verapdf/verapdf:latest'"
- First run will pull the Docker image automatically (~500MB)
- Requires internet connection
- Takes 1-2 minutes for initial download
Quarto not using Docker wrapper
- Check environment variable:
$env:QUARTO_VERAPDF - Should be set to
verapdf-docker - Restart PowerShell session after setting
Apache-2.0 (matches verapdf's license)