Hello and thanks for any assistance, I wrote this basic script to batch make test forms for a side project. In its current state it works fine and I can pass file names to it no problem. It will take the form embeded in the code and create 10 additional copies with the data in the lists (iamges,ssns...). However I'm stuck on how to pass the coordinates fo the queue types (R.Q1,Q2,Q3) to the draw.text statements.
I thought this might work but it doesn't:
qtype = raw_input("Enter queue type; R,Q1,Q2,Q3,IP,IBH:")
draw.text((qtype), prioritymark, font=fnt)
#!/usr/bin/python
import Image, ImageDraw, ImageFont, glob, re
from os import chdir, path
fname = raw_input("desired file name?")
print "I will now create 10 files starting with the name:", fname
images = [fname + '_01.jpeg', fname + '_02.jpeg', fname + '_03.jpeg', fname + '_04.jpeg', fname + '_05.jpeg', fname + '_06.jpeg', fname + '_07.jpeg', fname + '_08.jpeg', fname + '_09.jpeg', fname + '_10.jpeg']
ssns = ['111-22-3000', '111-22-3001', '111-22-3002', '111-22-3003', '111-22-3004', '111-22-3005', '111-22-3006', '111-22-3007', '111-22-3008', '111-22-3009']
bnames = ['Alfalfa', 'Darla', 'Porky', 'Buckwheat', 'Butch', 'Stymie', 'Norman', 'Pete', 'Wheezer', 'Scotty']
prioritymark = "X"
corres = "X"
address = "2019 Aerojet Rd, Rancho Cordova, CA"
R = "446,1013"
Q1 = "446,1274"
Q2 = "446,1654"
Q3 = "446,1654"
IP = "446,2195"
IBH = "446,2349"
def txt2img(text,fg="#000000",font="Verdana.TTF",FontSize=84):
font_dir = "/home/chris/.PlayOnLinux/fonts/"
font_size = FontSize
fnt = ImageFont.truetype(font_dir+font, font_size)
lineWidth = 20
img = Image.open("civform.jpeg")
draw = ImageDraw.Draw(img)
draw.text((1108,2763), text, font=fnt) # add some text to the main
draw.text((2231,15), images[index], font=fnt)
draw.text((2435,590), prioritymark, font=fnt)
###draw.text((3408,590), prioritymark, font=fnt)
draw.text((1524,2886), bnames[index], font=fnt)
draw.text((3071,1780), corres, font=fnt)
draw.text((1067,2995), address, font=fnt)
del draw
img.save(images[index],"JPEG",quality=55)
for index in range(len(ssns)):
txt2img(ssns[index])
print "done"