Creating PDF Files (without Acrobat)

From CS Support Wiki
Jump to: navigation, search

We often get requests from users who wish to create PDFs of documents they are working on. Many people wish to use Adobe Acrobat's PDFwriter which allows one to print directly to PDF. Unfortunately, we do not have a site license for Adobe Acrobat so users have to purchase them. This really applies to Windows and Mac users; the Linux systems all offer "print to PDF" directly from LibreOffice and LaTeX (now PDFtex).

If all you need to do is generate a PDF which you've authored in some other system, then you can use a ghostscript script called ps2pdf on the department Unix (Linux & Solaris) systems to create a PDF from a PS (PostScript) file. Ghostscript is an open-source implementation of PostScript.


First, create the PS file by editing with your favorite document authoring software (Word, etc.) and then "print" it, using the printer named "PSFile". PS file isn't an actual printer, but will generate a PostScript file of your document.


Brian Insert Screen captures here

Then, after saving your .PS file onto your K:\ drive (or in some way copying it to your home directory), you can log onto a power node and invoke ps2pdf to convert the file. Here is an example where I generate a PS file using the enscript program at the command line. The conversion to PDF is on the 6th line:


jpr9c@cordelia:~/temp$ echo "This is a test file" > test.txt
jpr9c@cordelia:~/temp$ cat test.txt
This is a test file
jpr9c@cordelia:~/temp$ enscript -1GR -p test.ps test.txt
[ 1 page * 1 copy ] left in test.ps
jpr9c@cordelia:~/temp$ ps2pdf test.ps test.pdf
jpr9c@cordelia:~/temp$ ls -l test.*
-rw-r--r-- 1 jpr9c staff 3081 Sep 29 16:34 test.pdf
-rw-r--r-- 1 jpr9c staff 13539 Sep 29 16:34 test.ps
-rw-r--r-- 1 jpr9c staff 20 Sep 29 16:33 test.txt

You should then be able to open your .PDF with your favorite PDF reader.