check out the python imaging library i think the package is python-imaging you should easily be able to make a script to convert from jpg to pdf Not sure if ghostscript is available but it probably use. You could use imagemagick + ghostscript too.