from fpdf import FPDF # Since standard FPDF doesn't support complex Gujarati Unicode fonts without specific setup, # I will use a clean layout with English headers and clear bullet points for maximum readability # as a professional summary of the text provided above. class ConstitutionPDF(FPDF): def header(self): self.set_font('Arial', 'B', 16) self.set_text_color(0, 51, 102) self.cell(0, 10, 'Indian Constitution Assembly Notes', 0, 1, 'C') self.set_draw_color(0, 51, 102) self.line(10, 22, 200, 22) self.ln(10) def section_title(self, title): self.set_font('Arial', 'B', 13) self.set_fill_color(230, 240, 255) self.set_text_color(0, 0, 0) self.cell(0, 10, f" {title}", 0, 1, 'L', True) self.ln(3) def content_text(self, text): self.set_font('Arial', '', 11) self.set_text_color(50, 50, 50) self.multi_cell(0, 7, text) self.ln(5) pdf = ConstitutionPDF() pdf.add_page() # Section 1 pdf.section_title('1. Evolution of Demand (1895 - 1940)') pdf.content_text( "• 1895: First demand by Bal Gangadhar Tilak.\n" "• 1922: Mahatma Gandhi: 'Indian destiny decided by Indians'.\n" "• 1928: Nehru Report (First Blueprint) by Motilal Nehru.\n" "• 1934: M.N. Roy gives formal idea of Constituent Assembly.\n" "• 1935: INC officially demands the Assembly.\n" "• 1940: August Offer - British government accepts demand." ) # Section 2 pdf.section_title('2. Assembly Composition (Cabinet Mission 1946)') pdf.content_text( "• Initial Strength: 389 Members.\n" "• After Partition: 299 Members.\n" " - British Provinces: 229 (Highest: UP - 55)\n" " - Princely States: 70 (Highest: Mysore - 07)\n" "• Women Members: 15 (President: Hansa Mehta)\n" "• SC: 33 | ST: 03" ) # Section 3 pdf.section_title('3. Key Dates & Meetings') pdf.content_text( "• 9 Dec 1946: 1st Meeting (Temp President: Sachchidananda Sinha)\n" "• 11 Dec 1946: Permanent President: Dr. Rajendra Prasad\n" "• 13 Dec 1946: Objective Resolution by Jawaharlal Nehru" ) # Section 4 pdf.section_title('4. Major Committees & Chairmen') pdf.content_text( "• Drafting Committee: Dr. B.R. Ambedkar\n" "• Union Power / Constitution: Jawaharlal Nehru\n" "• Provincial / Fundamental Rights: Sardar Vallabhbhai Patel\n" "• Steering Committee: Dr. Rajendra Prasad\n" "• Flag Committee: J.B. Kripalani" ) # Section 5 pdf.section_title('5. Drafting Committee Trick (7 Members)') pdf.content_text( "Trick Phrase: 'Ambedkar and Gopal, Krishna sathe Khetarma Munshine Madhav pase lavya.'\n" "1. Dr. B.R. Ambedkar (Chairman)\n" "2. N. Gopalaswami Ayyangar (Gopal)\n" "3. Alladi Krishnaswami Ayyar (Krishna)\n" "4. K.M. Munshi (Kanaiyalal)\n" "5. Muhammed Sadulla\n" "6. N. Madhava Rau (Madhav)\n" "7. T.T. Krishnamachari (Krishna)" ) # Section 6 pdf.section_title('6. Final Stats') pdf.content_text( "• Time Taken: 2 Years, 11 Months, 18 Days.\n" "• Total Sessions: 11 Sessions.\n" "• Total Cost: ~64 Lakh Rupees.\n" "• Adopted: 26 Nov 1949 (Constitution Day)\n" "• Enforced: 26 Jan 1950 (Republic Day)" ) output_path = "/mnt/data/Indian_Constitution_Notes_Gujarati.pdf" pdf.output(output_path)

0 comments: