# 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
PDF文件转换 DOC XLS PPPT
发表评论