通过命令行将PDF批量转换为EPS
我正在尝试通过inkscape和python将一些数字从 *.pdf转换为 *.eps。我求助于 inkscape手册和 inkscape wiki 并提出以下代码。但是,当我运行脚本时,没有将输出写入工作目录中。
import os
import subprocess
# Change to working directory
os.chdir("C:/Users/Username/Figures")
# Iterate over all PDF figures
for figure in [i for i in os.listdir() if i[-4:]=='.pdf']:
subprocess.run([
"C:/Program Files/Inkscape/inkscape.exe",
figure, # Input figure
f"--export-filename={figure[:-4]}.eps", # Output figure
"--batch-process"
])
还有一个 stackoverflow上的类似问题。但是,如果我将 *.emf替换为 *.eps 答案 latex无法读取文件。
更新:Inkscape版本0.92.4(5DA689C313,2019-01-14)
I am trying to convert some figures from *.pdf to *.eps via Inkscape and Python. I resorted to the Inkscape Manual and Inkscape Wiki and came up with the code below. However when I run the script, no output is written into the working directory.
import os
import subprocess
# Change to working directory
os.chdir("C:/Users/Username/Figures")
# Iterate over all PDF figures
for figure in [i for i in os.listdir() if i[-4:]=='.pdf']:
subprocess.run([
"C:/Program Files/Inkscape/inkscape.exe",
figure, # Input figure
f"--export-filename={figure[:-4]}.eps", # Output figure
"--batch-process"
])
There is also a similar question on Stackoverflow. However, if I replace *.emf with *.eps in the answer the files cannot be read by LaTeX.
Update: Inkscape version 0.92.4 (5da689c313, 2019-01-14)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论