

def txt_to_pdf(self):
    'text to pdf conversion, use a2ps and ps2pdf command (a2ps & ghostscript)'
    path = (os.path.join(os.path.dirname(self.filepath), self.document) + '.pdf')
    p = Popen(('a2ps --quiet --portrait --columns=1 --rows=1 -L 100 --no-header --borders=off -o - %s | ps2pdf -sPAPERSIZE=a4 - %s' % (self.filepath, path)), shell=True, stdout=PIPE, stderr=PIPE)
    (stdout, stderr) = p.communicate()
    content = open(path, 'rb').read()
    p = Popen(('rm -rf %s' % path), shell=True, stdout=PIPE, stderr=PIPE)
    return ['application/pdf', stdout]

dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/libraries/adlibre/converter.py FileConverter.txt_to_pdf/VarMisuse@121/238 `content`->`stdout`