PDF文件转换 DOC XLS PPPT


# libreoffice --convert-to pdf:writer_pdf_Export --outdir <保存的目录> a.docx

#保存在当前的download文件夹
def topdf(nfile):
    com="libreoffice --convert-to pdf:writer_pdf_Export "+nfile+" --outdir ./download"
    os.system(com)
    name=nfile[nfile.rfind('/')+1:nfile.rfind('.')]+".pdf"
    newa="./download/"+name
    return newa

发表回复