Created
December 23, 2020 16:14
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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