Ghostscript: How to Convert JPEG to PDF

By Jonah Quant

Ghostscript is a software suite containing utilities to convert and manipulate graphical documents in Adobe's PostScript and Portable Document Format (PDF) formats. Ghostscript can generate files in many standard image formats from a PostScript or PDF document, or vice versa. In particular, you can use "gs" (the main utility included in the Ghostscript suite) to convert an image file in JPEG format to PDF.

Step 1

Click "Start," then type "cmd" into the search box and press "Enter." A Command window will open.

Step 2

Type the following commands into the Command window:

c:

cd "\"

dir /s viewjpeg.ps

Press "Enter" at the end of each line. The output of the "dir" command will include the full path to the built-in "viewjpeg.ps" file. That file is always present in all installations of Ghostscript, but its location varies depending on the release of Ghostscript and on other configuration parameters. Make a note of that full path.

Step 3

Type the following command into the Command window to have "gs" perform the format conversion:

gs -sDEVICE=pdfwrite -o myFile.pdf "C:\Programs\Ghostscript\lib\viewjpeg.ps" -c myFile.jpg viewJPEG

Replace "C:\Programs\Ghostscript\lib\viewjpeg.ps" with the full path obtained in Step 2. Replace "myFile.jpg" with the file name of the JPEG file you need to convert. Press "Enter." After "gs" finishes executing, the PDF equivalent of your JPEG file will be stored in file "myFile.pdf".

×