Skip to content

Instantly share code, notes, and snippets.

@keflavich
Created February 4, 2023 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keflavich/72cfe496217585823eda3a827f2c98cd to your computer and use it in GitHub Desktop.
Save keflavich/72cfe496217585823eda3a827f2c98cd to your computer and use it in GitHub Desktop.
PDFA creation
# one-liner to convert PDF to PDFA using ghostscript to meet NSF PAR requirements
gs -dPDFA -dNOOUTERSAVE -dBATCH -dNOPAUSE -sProcessColorModel=DeviceRGB -dUseCIEColor -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sOutputFile=${fn/.pdf/_PDFA.pdf} $fn
# loop to do that to all files in a directory
for fn in *.pdf; do if [[ $fn != *pdfa* ]]; then if [ ! -f ${fn/.pdf/_PDFA.pdf} ]; then echo $fn; gs -dPDFA -dNOOUTERSAVE -dBATCH -dNOPAUSE -sProcessColorModel=DeviceRGB -dUseCIEColor -sColorConversionStrategy=UseDeviceIndependentColor -sDEVICE=pdfwrite -dPDFACompatibilityPolicy=1 -sOutputFile=${fn/.pdf/_PDFA.pdf} $fn; fi; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment