import os import shutil import sys from subprocess import call if __name__ == '__main__': example_pdf_pth = '/project/example/example.pdf' pdffigures2_home = '/opt/pdffigures2' args = [ 'sbt', '-J-Xmx4G', 'runMain org.allenai.pdffigures2.FigureExtractorBatchCli -e -q /project/example/ -m ./example/image/ -d ./example/json/ -s ./example/stat.json', ] call(args, cwd=pdffigures2_home)