# $Id: ps2pdf,v 1.1 2000/03/09 08:40:40 lpd Exp $
# Convert PostScript to PDF.
# Currently, we produce PDF 1.2 by default, but this is not guaranteed
# not to change in the future.
exec ps2pdf12 "$@"
One more thing:
the above code snippet is just part of a small python cgi script (test.cgi).
Case 1: If I ran it from shell:
A good file.pdf was generated.
Case 2: If the test.cgi was invoked from the corresponding webpage, then a file.pdf with no pages was generated.
I guess the only difference between the two cases is the user. In case 1, a local user (root) invoked test.cgi while , in case 2, a web user (apache) did it. However, I still have no idea how to fix the problem.
It is possible that (a) there are two versions of ps2pdf installed on your system, and the apache user uses one and the root user uses the other, or the more likely case, (b) something in the root environment which is necessary for ps2pdf's proper function is missing in the apache environment.
Have you tried to switch to the apache user, then run ps2pdf at the command line? Barring that, you could try having your web script print the environment variables (this would be the apache user's environment) and compare them to the root user's environment variables.