Skip to content

Instantly share code, notes, and snippets.

View WZot's full-sized avatar
🎯
Focusing

Espen Sae-Tang Ottersen WZot

🎯
Focusing
View GitHub Profile
@WZot
WZot / convert-pdf-to-pdfa.sh
Created February 2, 2019 13:10
Conversion of PDF file to PDF/A using psdf2ps and ghostscript
#!/usr/bin/env bash
# Convert to PS
pdf2ps before.pdf temp.ps
# Convert to PDF/A with small file size output
gs -q -dNOPAUSE -dBATCH -dSAFER -dPDFA=2 -dPDFACompatibilityPolicy=1 -dSimulateOverprint=true -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dAutoRotatePages=/None -dColorImageDownsampleType=/Bicubic -dColorImageResolution=150 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=150 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=150 -sOutputFile=after-small.pdf temp.ps
# Convert to PDF/A with bigger file size output
gs -dPDFA -dBATCH -dNOPAUSE -dPDFSETTINGS=/prepress -dNOOUTERSAVE -sColorConversionStrategy=UseDeviceIndependentColor -sProcessColorModel=DeviceRGB -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=after-big.pdf temp.ps

Keybase proof

I hereby claim:

  • I am wzot on github.
  • I am wzot (https://keybase.io/wzot) on keybase.
  • I have a public key ASCfI_AU9y5xwg23tYWOSBP40-J_TinzPdz-u1j4or3jXgo

To claim this, I am signing this object: