def gs_ps2pdf(input_ps, output_pdf):
    """ Use Ghostscript to convert PS file to PDF file """
    if os.path.exists(GSC):
        println("gs_ps2pdf: %s -> %s" % (input_ps, output_pdf))
        args =[GSC, 
            "-o", output_pdf, 
            "-sDEVICE=pdfwrite", 
            "-dPDFSETTINGS=/prepress", 
            "-dEmbedAllFonts=true", 
            "-dSubsetFonts=false", 
#            "-sFONTPATH=%s" % CUSTOM_FONTS  # for custom fonts if any
            "-dBATCH",
            "-dQUIET",
            "-c", ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams", 
            "-f"]
        args.append(input_ps)
        subprocess.call(args)
    else:
        println("%s not installed." % GSC)
 Use Ghostscript to convert PS file to PDF file 
recipes/Python/579136_Roll_your_own_Postscript_code/recipe-579136.py