My professor and I both use Linux to run some CFD codes, but both our PDF outputs from enscript do not open on Windows (which the TA uses to correct my assignment). The pdf's open without a problem in Linux however (my prof uses native Fedora and I use Ubuntu 16.04 on a virtual machine.
Here is the command line that I used:
enscript --color --pretty-print=cpp Assignment5.cpp --line-numbers -p Assignment5.pdf
And I got this error when trying to open the PDF in windows:

Thanks!
enscriptactually creates a postscript file, not a PDF file. Most likely the PDF viewer used on the Linux systems in question also can display postscript files and, therefore, did not complain while the PDF viewer used on Windows can not. To actually create a PDF runps2pdfon theenscriptoutput.On
enscriptenscript(at least the GNU version) does not output PDF but a choice of other formats:According to its man page the actual output format is selected using the -W / --language option:
Your
enscriptcall does not include this option. Thus, by default postscript is generated.How to create PDF
A common tool on Linux systems is
ps2pdfwhich you can use to generate a PDF from yourenscriptpostscript output:According to its man page it can be called with merely the source postscript and target PDF file names on the command line:
You may have yet to install ghostscript to run it.