[英]How to convert PDF to HTML using pdf2htmlEX and Python?
Just use the subprocess module只需使用子流程模块
import subprocess
subprocess.call("pdf2htmlEX /path/to/foobar.pdf", shell=True)
It calls the executable pdf2htmlEX
.它调用可执行文件pdf2htmlEX
。 It must be somwhere in your $PATH
, or you can put the absolute path in the call
它必须在您的$PATH
某处,或者您可以将绝对路径放在call
中
If you want to give path of file separately instead of giving it in.call function you can do this:如果你想单独给出文件路径而不是给它 in.call 函数,你可以这样做:
import subprocess
>> path = "/home/temp/abc.pdf"
>> subprocess.call(["pdf2htmlEX" ,path], shell=False)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.