#!/bin/bash

# Taken from:
# https://www.conference-publishing.com/Help.php

# This shell script helps to transform PDF files that refer to external fonts
# into PDF files that follow the PDF/A standard (ISO 19005, http://en.wikipedia.org/wiki/PDF/A).

# Apply this transformation only if the PDF file uses unembedded fonts (find out perhaps using 'pdffonts').
# Check figures for quality after processing.
# If not sufficient, use options like -dColorImageFilter=/FlateEncode,
# as described in the Ghostscript documentation (http://ghostscript.com/doc/current/Ps2pdf.htm).

for file in *.pdf; do
  ps2pdf -dPDFA $file
  # The above is an abbreviation for:
  # gs -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dPDFA -sOutputFile=$file.pdf $file
done

