lib/matplotlib/backends/backend_ps.py
def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None):
    """
    Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
    This yields smaller files without illegal encapsulated postscript
    operators. This distiller is preferred, generating high-level postscript
    output that treats text as text.
    """
    pdffile = tmpfile + '.pdf'
    psfile = tmpfile + '.ps'
    outfile = tmpfile + '.output'
    command = 'ps2pdf -dAutoFilterColorImages=false \
-sColorImageFilter=FlateEncode -sPAPERSIZE=%s "%s" "%s" > "%s"'% \
(ptype, tmpfile, pdffile, outfile)
    if sys.platform == 'win32': command = command.replace('=', '#')
    verbose.report(command, 'debug')
    exit_status = os.system(command)
    fh = file(outfile)
    if exit_status: raise RuntimeError('ps2pdf was not able to process your \
image.\n\Here is the report generated by ghostscript:\n\n' + fh.read())
    else: verbose.report(fh.read(), 'debug')
    fh.close()
    os.remove(outfile)
    command = 'pdftops -paper match -level2 "%s" "%s" > "%s"'% \
                (pdffile, psfile, outfile)
    verbose.report(command, 'debug')
    exit_status = os.system(command)
    fh = file(outfile)
    if exit_status: raise RuntimeError('pdftops was not able to process your \
image.\nHere is the full report generated by pdftops: \n\n' + fh.read())
    else: verbose.report(fh.read(), 'debug')
    fh.close()
    os.remove(outfile)
    os.remove(tmpfile)
    shutil.move(psfile, tmpfile)
    if eps:
        pstoeps(tmpfile, bbox)
    for fname in glob.glob(tmpfile+'.*'):
        os.remove(fname)

    Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
    This yields smaller files without illegal encapsulated postscript
    operators. This distiller is preferred, generating high-level postscript
    output that treats text as text.
    
Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
This yields smaller files without illegal encapsulated postscript
operators. This distiller is preferred, generating high-level postscript
output that treats text as text.
Use ghostscript ' s ps2pdf and xpdf ' s / poppler ' s pdftops to distill a file . This yields smaller files without illegal encapsulated postscript operators . This distiller is preferred generating high - level postscript output that treats text as text .
def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None):
    pdffile = tmpfile + '.pdf'
    psfile = tmpfile + '.ps'
    outfile = tmpfile + '.output'
    command = 'ps2pdf -dAutoFilterColorImages=false \
-sColorImageFilter=FlateEncode -sPAPERSIZE=%s "%s" "%s" > "%s"'% \
(ptype, tmpfile, pdffile, outfile)
    if sys.platform == 'win32': command = command.replace('=', '#')
    verbose.report(command, 'debug')
    exit_status = os.system(command)
    fh = file(outfile)
    if exit_status: raise RuntimeError('ps2pdf was not able to process your \
image.\n\Here is the report generated by ghostscript:\n\n' + fh.read())
    else: verbose.report(fh.read(), 'debug')
    fh.close()
    os.remove(outfile)
    command = 'pdftops -paper match -level2 "%s" "%s" > "%s"'% \
                (pdffile, psfile, outfile)
    verbose.report(command, 'debug')
    exit_status = os.system(command)
    fh = file(outfile)
    if exit_status: raise RuntimeError('pdftops was not able to process your \
image.\nHere is the full report generated by pdftops: \n\n' + fh.read())
    else: verbose.report(fh.read(), 'debug')
    fh.close()
    os.remove(outfile)
    os.remove(tmpfile)
    shutil.move(psfile, tmpfile)
    if eps:
        pstoeps(tmpfile, bbox)
    for fname in glob.glob(tmpfile+'.*'):
        os.remove(fname)
def xpdf_distill ( tmpfile , eps = False , ptype = 'letter' , bbox = None ) : pdffile = tmpfile + '.pdf' psfile = tmpfile + '.ps' outfile = tmpfile + '.output' command = 'ps2pdf -dAutoFilterColorImages=false \
-sColorImageFilter=FlateEncode -sPAPERSIZE=%s "%s" "%s" > "%s"' % ( ptype , tmpfile , pdffile , outfile ) if sys . platform == 'win32' : command = command . replace ( '=' , '#' ) verbose . report ( command , 'debug' ) exit_status = os . system ( command ) fh = file ( outfile ) if exit_status : raise RuntimeError ( 'ps2pdf was not able to process your \
image.\n\Here is the report generated by ghostscript:\n\n' + fh . read ( ) ) else : verbose . report ( fh . read ( ) , 'debug' ) fh . close ( ) os . remove ( outfile ) command = 'pdftops -paper match -level2 "%s" "%s" > "%s"' % ( pdffile , psfile , outfile ) verbose . report ( command , 'debug' ) exit_status = os . system ( command ) fh = file ( outfile ) if exit_status : raise RuntimeError ( 'pdftops was not able to process your \
image.\nHere is the full report generated by pdftops: \n\n' + fh . read ( ) ) else : verbose . report ( fh . read ( ) , 'debug' ) fh . close ( ) os . remove ( outfile ) os . remove ( tmpfile ) shutil . move ( psfile , tmpfile ) if eps : pstoeps ( tmpfile , bbox ) for fname in glob . glob ( tmpfile + '.*' ) : os . remove ( fname )
Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
Use ghostscript ' s ps2pdf and xpdf ' s / poppler ' s pdftops to distill a file .
"""
    Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
    This yields smaller files without illegal encapsulated postscript
    operators. This distiller is preferred, generating high-level postscript
    output that treats text as text.
    """
tmpfile
eps
ptype
bbox