Need script to generate vouchers
I have a file, two columns, first column has a list of 15000 (yes 15k) unique codes, second column has the afilliate codes of 60 locations repeated to fill out the 15000 rows of unique codes.
I need to produce a nice neat paper voucher which will fit onto A6 (1/4 A4) and is ready to print. Each voucher has the unique code and corresponding location. So far I am thinking PHP will do the job. This does it somewhat, but doesn't let be split the fields between the ",". I did this so far in PHP Code:
<? |
I would use imagemagick to create each file, so that you can specify the dimensions.
Alternatively, use htmldoc to create a pdf for each voucher, you can specify the page dimensions there too. You will have to experiment to get the correct alignment. Both those tools can be scripted and sent commands from your script. I once used perl to create individual certificates in pdf format from database fields, running as a cgi script on a web server. |
I've now achieved what i want to do. Managed to get the list of afilliates re-organised thanks to some bash scripting. Took a while to get sed to play ball though. I don't think it likes variables that much!
Code:
for (( vet=1; vet<=60; vet++ )) ; do for (( repeat=1; repeat <=250; repeat++ )); do echo $vet; sed $vet'q;d' "populate.csv" >> newvetslist; done; done; Code:
<? I hope its helpful to somebody. |
Finally got it working, complete with page break every 3 pages
Code:
<STYLE> |
All times are GMT -5. The time now is 03:51 PM. |