Python Code
1 from fpdf fpdf import import FPDF
2
3 class ProjectPDF( (FPDF FPDF) ):
4 def header( (self self) ):
5 # Decorative line at top
6 self. set_draw_color( (0 0, 0, 0)
7 self. .line line( (10 10, 10, 200, 10)
8 self. .ln ln( (5 5)
9
10 def footer( (self self) ):
11 # Position at 1.5 cm from bottom
12 self. .set_y set_y( (--15 15)
13 self. .set_font set_font( 'I', 8)
14
('Times'
self. .cell 'Times',
cell( (0 10, 'Page ' + str( (self self. 0, 0, 'C')
15 0, .page_no
16 def chapter_title( (self self, , title title) ):
17 self. .set_font set_font( ('Arial' 'Arial', 'B', 16)
18 self. .cell cell( (0 0, 10, , title title, 0, 1, 'C')
19 self. .ln ln( (5 5)
20
21 def chapter_body( (self self, , body body) ):
22 self. .set_font set_font( ('Times' 'Times', '', 12)
23 self. multi_cell( (0 0, 8, , body body)
24 self. .ln ln( ()
25
26 def add_image_placeholder( (self self, , label label, , height height=
27 =60 60) ):
self. set_fill_color( 230, 230) # Light grey
28 (230 230,
self. .rect rect( (self self. .get_x get_x( () ), , self self. 190, , height 'F')
29 .get_y get_y( () ), height,
30 # Center text in box
31 current_y = = self self. .get_y get_y( ()
32 self. .set_y (height height/ /2 2) - 4)
33 set_y(
self. (curre 'I', 10)
34 .set_font
self. set_text_color( (100 100, 100, 100)
35 self. .cel 10, , label label, 0, 1, 'C')
36 l cell( (0
37 # Reset
38 self. 0, 0)
39 set_text_color(
self. .set_y set_y( (current_y + height height + 10)
40
41 pdf = = ProjectPDF ()
42 pdf. set_auto_page_break( (auto auto= =True True, , margin margin= =15 15)
43
44 # --- PAGE 1: COVER ---
45 pdf. .add_page add_page( ()
46 pdf. .ln ln( (40 40)
47 pdf. .set_font set_font( ('Arial' 'B', 24)
48 'Arial',
pdf. .cell 20, 'ENGLISH PROJECT', 0, 1, 'C')
49 cell( (0 0,
pdf. .set_font set_font( ('Arial' 'B', 16)
50 'Arial',
pdf. .cell 10, 'SESSION 2024-25', 0, 1, 'C')
51 cell( .ln
pdf. (0 0,
ln( (20 20)
52
53 # Decorative Placeholder
54 pdf. add_image_placeholder( ("[Insert Visual: Abstract Image Representing Fear/
Water]", 50)
55 pdf. .ln ln( (10 10)
56
57 pdf. .set_font set_font( 'B', 18)
58 ('Arial'
pdf. .c 'Arial',
10, 'TOPIC: CONQUERING THE 0, 1, 'C')
59 ell cell(
pdf. .set_font set_font( ABYSS',
'I', 14)
60 ('Times'
pdf. .c 'Times',
10, "An Analysis of Fear and Resilience based on 'Deep Water'",
0, 1, 'C')ell cell(
61
62 pdf. .ln ln( (30 30)
63 pdf. .set_font set_font( ('Arial' 'B', 12)
64 'Arial',
pdf. .cell 10, 'Submitted to:', 0, 0, 'L')
65 cell( .cell
pdf. (95 10, 'Submitted by:', 0, 1, 'R')
66 cell( (95
6 pdf. .set_font '', 12)
7 set_font(
pd 10, ('Times' 'Mr. Mukesh Vashishth', 0, 0, 'L')
f. . 10,
pd 'Suvajit Majumdar', 0, 1, 'R')
f. .
pd 10, '(PGT English)', 0, 0, 'L')
f.
pd . 10, 'Class: XII - [Sec]', 0, 1, 'R')
6
f. .
8 pd 10, '', 0, 0, 'L')
f. .
pd 10, 'Roll No: 07', 0, 1, 'R')
74f. .
75 # --- PAGE 2: CERTIFICATE ---
76 pdf. .add_page add_page( ()
77 pdf. .rect 10, 190, 277) # Border
78 rect( (10
pdf. .ln ln(10,
(10 10)
79 pdf. chapter_title( 'CERTIFICATE')
80 pdf. .ln ln( (20 20)
81 certificate_text = (
82
"This is to certify that Suvajit Majumdar, Roll No. 07, a student of Cla
ss XII, "
83 "has successfully completed the project on the topic 'Overcoming Fear' u
nder the "
84 "guidance of Mr. Mukesh Vashishth during the academic year 2024-25 in pa
rtial "
85 "fulfillment of the English Core examination conducted by the CBSE.\n\n"
86 "The work is original and has not been submitted elsewhere."
87 )
88 pdf. chapter_body( certificate_text)
89 pdf. .ln ln( (60 60)
90 pdf. .ce 10, '_________ 0, 0, 'L')
91 ll cell(
pdf. .ce 10, _________'
'_________ 0, 1, 'R')
92 ll cell( _________'
pdf. .ce 10, "Teacher's 0, 0, 'L')
93 ll cell( Signature",Signature",
pdf. .ce 10, "Principal's 0, 1, 'R')
94 ll cell(
95 # --- PAGE 3: ACKNOWLEDGEMENT ---
96 pdf. .add_page add_page( ()
97 pdf. chapter_title( 'ACKNOWLEDGEMENT')
ack_text = (
98
99 "I would like to express my deepest gratitude to my English teacher, Mr.
Mukesh Vashishth, "
100 "for his invaluable guidance and mentorship. His insightful explanations
of William Douglas's "
101 "'Deep Water' provided the intellectual foundation necessary to complete
this project.\n\n"
102 "I am also thankful to our Principal and the school administration for p
roviding the necessary "
103 "resources and a conducive environment for learning.\n\n"
104 "Lastly, I thank my parents and friends for their constant encouragement
and support, "
105 "which kept me motivated throughout this endeavor."
106 )
107 pdf. chapter_body( (ack_text ack_text)
108
10 # --- PAGE 4: INDEX ---
9 pdf. .add_page add_page( ()
11 pdf. chapter_title( ('INDEX' 'INDEX')
0 pdf. .set_font set_font( ('Arial' 'Arial', 'B', 12)
11 pdf. . 10, '[Link]', 1, 0, 'C')
1 cell .cell cell(
pdf. 10, 'Topic', 1, 0, 'C')
11 (140. 140, 10,
pdf. 'Page No', 1, 1, 'C')
2
116 cell
117 topics [
118 = ("1" "1", "Introduction: The Nature of Fear", "5") ),
119 ("2" "2", "The Psychology: Biology of Panic", "6") ),
120 ("3" "3", "Deep Water: The Incident & Trauma", "7") ),
121 ("4" "4", "The Struggle: Steps to Recovery", "9") ),
122 ("5" "5", "Strategies for Mastery", "10") ),
123 ("6" "6", "Student Reflection", "11") ),
124 ("7" "7", "Conclusi "12") ),
125 on",
("8" "8", "Bibliography", "13")
126
]
127
128 pdf. .set_font '', 12)
129 set_font(
for ('Times'
sno sno, , topic topic, , page page in in topics topics:
130 10, , sno sno, 1, 0, 'C')
131 ppdf. .cell 10, ' ' + topic topic, 1, 0, 'L')
132 cell( (14010, , page page, 1, 1, 'C')
133 p
134 # --- PAGE 5: INTRODUCTION ---
135 pdf. .add_page add_page( ()
136 pdf. chapter_title( 'INTRODUCTION: THE NATURE OF FEAR')
137 pdf. .set_font set_font( ('Times' 'Times', 'I', 12)
138 pdf. multi_cell( (0 0, 10, '"The only thing we have to
anklin D. Roosevelt', 0, 'C') fear is fear itself." - Fr
139 pdf. .ln ln( (5 5)
140
141 pdf. add_image_placeholder( ("[Insert Image: Portrait of Franklin D. Roosevel
t]", 50)
142
143 intro_text = (
"Fear is perhaps the most primal of human emotions. Evolutionarily, it s
144
erved as a survival "
145 "mechanism, alerting early humans to predators and danger. However, in t
he modern world, "
146 "fear often manifests not as a physical threat, but as a psychological b
arrier.\n\n"
147 "It acts as a pervasive inhibitor, limiting potential and stifling creat
ivity. As noted in psychology, "
148 "fear is a natural response created by the mind to warn us of danger. Bu
t when fear grows "
149 "beyond reason, it becomes an obstacle that limits our thinking.\n\n"
150 "This project explores the nuances of fear through the lens of William D
ouglas's autobiographical "
151 "account, 'Deep Water'. It examines how a childhood phobia can define a
life, and more importantly, "
152 "how the human spirit can engineer its own liberation."
153 )
154 pdf. chapter_body( intro_text)
155
156 # --- PAGE 6: PSYCHOLOGY ---
157 pdf. .add_page add_page( ()
158 pdf. chapter_title( 'THE PSYCHOLOGY OF FEAR')
159
160 pdf. add_image_placeholder( ("[Insert Image: Diagram of Brain highlighting Amyg
dala]", 60)
161
162 psych_text = (
163 "Fear is rarely a standalone emotion; it is a culmination of memory, env
ironment, and conditioning.\n\n"
164 "1. Conditioned Response: As seen in the 'Little Albert Experiment' by W
atson and Rayner, "
165 "fear can be learned through association. Douglas's aversion to water wa
s not innate but conditioned "
166 "by trauma.\n\n"
167 "2. The Amygdala's Role: Modern neuroscience tells us that the amygdala
triggers the 'fight or flight' "
168 "response. In Douglas's case, the mere sight of the pool triggered a bio
logical panic hijack.\n\n"
169 "3. Social Impact: A supportive environment fosters courage, while a cri
tical one breeds insecurity. "
170 "The fear of judgment often weighs heavier than the fear of the activity
itself."
171 )
172 pdf. chapter_body( psych_text)
173
174 # --- PAGE 7: ANALYSIS ---
175 pdf. .add_page add_page( ()
176 pdf. chapter_title( 'LITERARY ANALYSIS: DEEP WATER')
177
178 pdf. add_image_placeholder( ("[Insert Image: A silhouette of a swimmer underwat
er]", 60)
179
180 analysis_text = (
181 "In 'Deep Water', William Douglas vividly describes fear not as an abstr
act concept, but as a physical entity. "
182 "His trauma was two-fold:\n\n"
183 "1. The California Beach: At age three, he was knocked down by waves. Th
e sensation of suffocation "
184 "planted the first seeds of terror.\n\n"
185 "2. The YMCA Incident: The defining moment occurred when a 'big bruiser'
of a boy tossed him into "
186 "the deep end of the pool.\n\n"
187 "Douglas details the physical paralysis—his lungs ready to burst and his
legs hanging as dead weights. "
188 "The aftermath was a 'haunting fear' that ruined his fishing trips and d
eprived him of the joy of canoeing "
189 "and swimming. The fear had become his master."
190 )
191 pdf. chapter_body( analysis_text)
192
193 # --- PAGE 8: THE JOURNEY ---
194 pdf. .add_page add_page( ()
195 pdf. chapter_title( 'FROM PARALYSIS TO PERSISTENCE')
196
197 pdf. add_image_placeholder( ("[Insert Image: A serene lake (representing Lake W
entworth)]", 60)
198
199 journey_text = (
200 "The turning point in Douglas's life was the realization that he was 'ti
red of living half a life'. "
201 "His journey to recovery highlights a specific methodology:\n\n"
202 "• Acknowledgement: He admitted that he could not conquer this alone and
hired an instructor.\n\n"
203 "• Gradual Exposure: The instructor used a belt and pulley system. They
practiced back and forth, "
204 "hour after hour, day after day.\n\n"
205 "• Micro-Skills: Douglas learned to exhale underwater and inhale above w
ater. He broke the 'big fear' "
206 "into small, manageable technical skills.\n\n"
207 "Even after the instructor left, Douglas was not satisfied. He tested hi
mself in Lake Wentworth "
208 "and Warm Lake to ensure the 'vestiges' of fear were gone."
209 )
210 pdf. chapter_body( journey_text)
211
212 # --- PAGE 9: STRATEGIES ---
213 pdf. .add_page add_page( ()
214 pdf. chapter_title( 'STRATEGIES FOR MASTERY')
215 strategies_text = (
216 "Drawing from Douglas's experience and modern psychology, we can identif
y key steps to fear management:\n\n"
217 "1. Confrontation over Avoidance: Fear grows when ignored. Confronting i
t strips it of its power.\n\n"
218 "2. Rationalization: Ask yourself, 'Is this fear based on reality or ima
gination?' Douglas realized "
219 "his fear was a memory, not a present danger.\n\n"
220 "3. Consistency: Douglas didn't learn in a day. It was a process of 'hun
dreds of small practices "
221 "stitched together'. Consistency beats intensity.\n\n"
222 "4. The Growth Mindset: Viewing failure as a stepping stone rather than
a stop sign."
223 )
224 pdf. chapter_body( strategies_text)
225 pdf. .ln ln( (10 10)
226 pdf. .set_font set_font( ('Times' 'Times', 'I', 14)
227 pdf. .cell cell( 10, '"Courage is resistance to fear, mastery of fear, not
(0 0, absenc
e of fear."', 0, 1, 'C')
228 pdf. .set_font set_font( ('Times' 'Times', '', 12)
229 pdf. .cell cell( (0 0, 10, '- Mark Twain', 0, 1, 'C')
230
231
232 # --- PAGE 10: REFLECTION ---
233 pdf. .add_page add_page( ()
234 pdf. chapter_title( 'STUDENT REFLECTION')
235 reflection_text = (
236 "Reading 'Deep Water' was not just a literary exercise but a lesson in h
uman resilience. "
237 "Douglas's story teaches us that peace is the result of conquest.\n\n"
238 "The most profound realization from the text is that 'In death there is
peace. There is terror only "
239 "in the fear of death.' This suggests that our anxiety about the future
is often more painful "
240 "than the future itself.\n\n"
241 "Like Douglas, I have realized that we all carry our own 'deep waters'—w
hether it is academic pressure, "
242 "fear of public speaking, or fear of failure. The solution is not to avo
id the water, but to learn "
243 "how to swim."
244 )
245 pdf. chapter_body( reflection_text)
246
247 # --- PAGE 11: CONCLUSION ---
248 pdf. .add_page add_page( ()
249 pdf. chapter_title( 'CONCLUSION')
250
251 pdf. add_image_placeholder( ("[Insert Image: Nelson Mandela or a person reachin
g a mountain peak]", 60)
252
253 concl_text = (
254 "William Douglas's journey transforms a simple swimming lesson into a me
taphor for life. "
255 "He moved from a paralyzed victim to a confident master of his destin
y.\n\n"
256 "The story concludes with a powerful message: the limits we face are oft
en self-imposed. "
257 "When we challenge the boundaries of our comfort zone, we do not just su
rvive; we thrive. "
258 "As Douglas stood on the peak, he had not just conquered the water; he h
ad conquered his own mind.\n\n"
259 "As Nelson Mandela famously said: 'I learned that courage was not the ab
sence of fear, but the triumph over it.'"
260 )
261 pdf. chapter_body( concl_text)
262
263 # --- PAGE 12: BIBLIOGRAPHY ---
264 pdf. .add_page add_page( ()
265 pdf. chapter_title( 'BIBLIOGRAPHY')
266 bib_text = (
267 "• Primary Source:\n"
268 " - Flamingo: English Core, Class XII, NCERT
269 Publications.\n" " - 'Deep Water' by William Douglas.\n\
n"
270 "• Secondary Sources:\n"
271 " - 'Understanding Fear and Human Behaviour', American Psychological A
ssociation (APA).\n"
272 " - NCERT Literature Resources and
273 Vedantu/Byju's Academic Notes.\n\n" "• Quotes
274 Referenced From:\n"
275 " - BrainyQuote & Goodreads Library.\n"
276 " - Official CBSE Resource Material."
277 )
278 pdf. chapter_body( (bib_text bib_text)
279 # Output
280 pdf. .output output(
"English_Project_Overcoming_Fear.pdf")