Thursday, February 11, 2010

Ubuntu: Convert postscript (.ps) to pdf

We can convert postscript (.ps) file to PDF file by Ghostscript command line. Ghostscipt have been bundled with Ubuntu. So, you can do following step for conversion:
1. Print your data to file by choose "Print To File"
2. Save file output as filename.ps
3. Open Terminal and type command as below:

gs -q -dBATCH -dAutoFilterColorImages=false -sColorImageFilter=FlateEncode -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=${output_file}.pdf ${ps_file}

${output_file} is your output filename that you want
${ps_file} is your postscript filename


No comments: