Skip to content

Instantly share code, notes, and snippets.

@aeturrell
Created December 23, 2020 16:14
Show Gist options
  • Select an option

  • Save aeturrell/f59db24f60151a1953b6caccfc9b38d7 to your computer and use it in GitHub Desktop.

Select an option

Save aeturrell/f59db24f60151a1953b6caccfc9b38d7 to your computer and use it in GitHub Desktop.
Convert pdfs in 'figures/' to eps in 'figures_eps/' using Inkscape called from a Python script.
import pathlib
import subprocess
figures_in = list(pathlib.Path('figures/').glob('*'))
for fig_path in figures_in:
out_path = (pathlib.Path('figures_eps') /
pathlib.Path(fig_path.stem).with_suffix('.eps'))
subprocess.run(["inkscape", fig_path, "-o", out_path,
"--export-ps-level=3"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment