I have a simple python script that prints pdf’s within a folder. I want the user to be able to make the script print multiple copies of the pdf’s.
Here is the script:
import arcpy, glob, win32api, os
pdfLoc = arcpy.GetParameterAsText(0)
# Loop through pdf directory and print from pdf
for pdfname in glob.glob(os.path.join(pdfLoc, "*.pdf")):
fullpath = os.path.join(pdfLoc, pdfname)
#print filename
win32api.ShellExecute(0, "print", pdfname, None, ".", 0)
del fullpath
del pdfname
del pdfLoc
I’m thinking something simple like another for loop to read the number of copies and make it loop that many times (i.e. if the user wants 3 copies, the loop will read this and loop 2 times through the print loop)
I hope this makes sense. Any suggestions are appreciated.
Mike
That’s very close to what you’d want to do. This example gets the number of copies from an optional extra command line parameter, then prints that many copies of each document: