-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.py
More file actions
120 lines (85 loc) · 3.34 KB
/
project.py
File metadata and controls
120 lines (85 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
from PIL import Image, ImageDraw, ImageFont
image = Image.new('RGB', (1500,900), (137, 239, 229))
draw = ImageDraw.Draw(image)
font = ImageFont.truetype('arial.ttf', size=45)
import random
import os
import datetime
import qrcode
os.system("title ID CARD Generator by Divesh")
d_date = datetime.datetime.now()
reg_format_date = d_date.strftime(" %d-%m-%Y\t\t\t\t\t ID CARD Generator\t\t\t\t\t %I:%M:%S %p")
print ('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
print (reg_format_date)
print ('+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++')
# staite Everything in uppercase letters')
(x, y) = (80, 75)
# message = "Writing position of the message"
print('\n\nAll Fields are Mandatory')
print('Avoid any kind of Spelling Mistakes')
print('SS COLLEGE OF ENGINEERING')
message = input('\nEnter Your Company Name: ')
company=message
color = 'rgb(0, 0, 0)' #colour=black
font = ImageFont.truetype('arial.ttf', size=80)
draw.text((x, y), message, fill=color, font=font)
# adding an unique id number. You can manually take it from user
(x, y) = (1130, 330)
idno=random.randint(10000000,90000000)
message = str('ID '+str(idno))
color = 'rgb(0, 0, 0)' # black color
font = ImageFont.truetype('arial.ttf', size=40)
draw.text((x, y), message, fill=color, font=font)
(x, y) = (450, 270)
message = input('Enter Your Full Name: ')
# message="bhargav sonagara"
name=message
color = 'rgb(0, 0, 0)' # black color
font = ImageFont.truetype('arial.ttf', size=40)
draw.text((x, y), "Name: "+message, fill=color, font=font)
(x, y) = (450, 390)
message = input('Enter Your Gender(M/F): ')
# message = "M"
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "Gender: "+message, fill=color, font=font)
(x, y) = (830, 390)
message = input('Enter Your Age: ')
# message = "21"
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "Age : "+message, fill=color, font=font)
(x, y) = (450, 500)
message = input('Enter Your Date Of Birth(DD-MM-YY): ')
# message = "20-10-1999"
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "DOB: "+message, fill=color, font=font)
(x, y) = (450, 600)
message = input('Enter Your Blood Group: ').upper()
# message = "A+"
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "Blood Group : "+message, fill=color, font=font)
(x, y) = (450, 690)
message = input('Enter Your Mobile Number: ')
# message = "9928862273"
temp=message
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "Phone: "+message, fill=color, font=font)
(x, y) = (450, 780)
message = input('Enter Your Address: ')
# message = "Near Baba Ramdev Temple Kherwara"
color = 'rgb(0, 0, 0)' # black color
draw.text((x, y), "Address: "+message, fill=color, font=font)
# save the edited image
image.save(str(name)+'.png')
img = qrcode.make(str(company)+str(idno)) # this info. is added in QR code, also add other things .
img.save("qrcode/"+str(idno)+'.bmp')
size=273,350
til = Image.open(name+'.png')
im = Image.open("qrcode/"+str(idno)+'.bmp') #25x25
til.paste(im,(1080,387))
imge = input("Enter image Name")
im1 = Image.open(imge)
im1 = im1.resize((272,350))
til.paste(im1,(80,300))
til.save("output/"+name+'.png')
print(('\n\n\nYour ID Card Successfully created in a PNG file '+name+'.png'))
input('\n\nPress any key to Close program...')