Bopytex/bopytex/worker/join_pdf.py

18 lines
413 B
Python

import subprocess
def pdfjam(args: dict, deps, output):
joining_process = subprocess.Popen(
["pdfjam"] + deps + ["-o", output],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
)
# exit_code is always 66...
exit_code = joining_process.wait()
if exit_code == 0:
yield "pdfjam success"
else:
yield "pdfjam failed"