Ghostscript PDF Converter

PDF files need to be in PDF-Format 1.4 or below in order to be able to process those files using fpdf/tcpdf php libraries. As most customers are unaware of this and aren’t able to convert their files to this format, i had to do this on my own:

# apt-get install ghostscript

# gs -sPAPERSIZE=a4 \
   -sDEVICE=pdfwrite \
   -dPDFSETTINGS=/prepress \
   -dEmbedAllFonts=true \
   -dCompatibilityLevel="1.4" \
   -dNOPAUSE \
   -dBATCH \
   -dSAFER \
   -sOutputFile=output.pdf \

This converts a given file “inputfile.pdf” from whatever PDF-version to version 1.4 as output.pdf.