0

I am writing a python script that will be called in a batch file, and in this script I am using the subprocess module to call PDF Combine to combine multiple PDF files into a single document.

for unique_id in newUnique_ids:
    subprocess.call(['K:\VALIDATION\Volumetric\Code_SAS\PDF Combine\PDF
    Combine\PDFCombine.exe','K:\VALIDATION\Volumetric\Forecast\MEVV\pdf\mevv.pdf\{0}*.pdf'.format
   (unique_id)])

PDF Combine is able to create a new document with all of the pdfs with the unique_id extension, but I receive an error from PDF combine due to the absence of a file name to save this new document under. How can I specify the file name I want the new document to save to in Python? The new documents file name would look like this in the code:

 'K:\VALIDATION\Volumetric\Forecast\MEVV\pdf\cmb.pdf\{0}.pdf'.format(line)

Thank you!

  • That's a question answered by pdfcombine's command line help documentation. Its likely just one more parameter in the list you pass in. – tdelaney Sep 19 '13 at 15:19
  • I found the answer. http://stackoverflow.com/questions/2919783/python-calling-a-non-python-program-from-python I was typing the output incorrectly before, and the link above showed me how to designate the output correctly within the subprocess.call statement. – Katherine Sep 19 '13 at 15:33

0 Answers0