调用libreoffice将ppt、word转换成pdf文件

soffice_path = ""
systype = platform.system()
if systype == "Linux":
    soffice_path = "/usr/bin/soffice"
elif systype == "Windows":
    soffice_path = "C:\\Program Files (x86)\\LibreOffice 5\\program\\soffice"
status = subprocess.call([
    soffice_path,
    "--headless",
    "--invisible",
    "--convert-to",
    "pdf",
    "--outdir",
    outdir,
    infilename.decode("utf-8").encode(sys.getfilesystemencoding())
])

[ 编辑 | 历史 ]
最近由“jilili”在“2017-05-19 10:15:48”修改