Skip to content

Instantly share code, notes, and snippets.

@strubell
Created June 1, 2015 00:51
Show Gist options
  • Save strubell/7b97e0858eed38bbad72 to your computer and use it in GitHub Desktop.
Save strubell/7b97e0858eed38bbad72 to your computer and use it in GitHub Desktop.
Convert a bunch of files from pdf -> svg using iesl-pdf-to-text
#!/bin/bash
#
# pdf2svg-parallel.sh
#
# Usage: pdf2svg-parallel.sh /dir/containing/pdfs /output/dir
#
# You must set the PDF2SVG_ROOT environment variable to a directory containing
# iesl-pdf-to-text, e.g. from that directory:
# export PDF2SVG_ROOT=`pwd`
#
input_dir=$1
output_dir=$2
cores=48
find $input_dir -type f \
| parallel -j $cores --eta $PDF2SVG_ROOT/bin/run.js --svg -i {} -o $output_dir/{/.}.svg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment