并行文档转换ODT> PDF的LibreOffice [英] Parallel Document Conversion ODT > PDF Libreoffice

查看:251
本文介绍了并行文档转换ODT> PDF的LibreOffice的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我转换数以百计的ODT文件为PDF文件,它需要很长的时间做一前一后。我有多个内核的CPU。是否有可能使用bash或Python编写一个脚本并行做这些?
有没有一种方法来并行(如果我用不知道正确的字),使用LibreOffice的命令行批量文件转换?
我一直在做它在Python / bash中调用下面的命令:

I am converting hundreds of ODT files to PDF files, and it takes a long time doing one after the other. I have a CPU with multiple cores. Is it possible to use bash or python to write a script to do these in parallel? Is there a way to parallelize (not sure if I'm using the right word) batch document conversion using libreoffice from the command line? I have been doing it in python/bash calling the following commands:

libreoffice --headless --convert-to pdf *appsmergeme.odt

subprocess.call(str('cd $HOME; libreoffice --headless --convert-to pdf *appsmergeme.odt'), shell=True);

感谢您!

推荐答案

您可以作为一个守护进程/服务运行的LibreOffice。请查看以下链接,也许它可以帮助你太:<一href=\"http://www.linuxquestions.org/questions/blog/sag47-492023/headless-file-conversion-using-libreoffice-as-a-service-35310/\"相对=nofollow称号=有用的链接>守护进程的LibreOffice的服务

You can run libreoffice as a daemon/service. Please check the following link, maybe it helps you too: Daemonize the LibreOffice service

其他posibility是使用 unoconv 。 unoconv是一个命令行实用工具,可以将任何文件格式的OpenOffice可以导入到任何文件格式,OpenOffice是可以导出的。

Other posibility is to use unoconv. "unoconv is a command line utility that can convert any file format that OpenOffice can import, to any file format that OpenOffice is capable of exporting."

这篇关于并行文档转换ODT&GT; PDF的LibreOffice的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆