Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions FusionIIIT/applications/examination/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2326,16 +2326,16 @@ def generate_student_result_pdf(self, request):

subtitle_style = ParagraphStyle(
'Subtitle',
parent=styles['Normal'],
parent=styles['Heading2'],
fontSize=11,
spaceAfter=6,
alignment=1, # Center
fontName='Times-Bold'
)

# Institution Header
story.append(Paragraph("PDPM Indian Institute of Information Technology, Design &", title_style))
story.append(Paragraph("Manufacturing, Jabalpur", title_style))
story.append(Paragraph("PDPM Indian Institute of Information Technology,", title_style))
story.append(Paragraph("Design & Manufacturing, Jabalpur", title_style))
story.append(Paragraph("(An Institute of National Importance under MoE, Govt. of India)", subtitle_style))
story.append(Paragraph("Semester Grade Report / Marksheet", subtitle_style))
story.append(Spacer(1, 20))
Expand Down Expand Up @@ -3474,7 +3474,8 @@ def post(self, request):
'Title',
parent=styles['Heading1'],
fontSize=14,
spaceAfter=8,
spaceAfter=2,
leading=18,
alignment=1, # Center
fontName='Times-Bold'
)
Expand All @@ -3501,10 +3502,10 @@ def post(self, request):
logo = Image(logo_path, width=0.8*inch, height=0.8*inch)

# Create separate paragraphs for better text formatting
title_para = Paragraph("PDPM Indian Institute of Information Technology, Design &", title_style)
subtitle1_para = Paragraph("Manufacturing, Jabalpur", title_style)
title_para = Paragraph("PDPM Indian Institute of Information Technology,", title_style)
subtitle1_para = Paragraph("Design & Manufacturing, Jabalpur", title_style)
subtitle2_para = Paragraph("(An Institute of National Importance under MoE, Govt. of India)", subtitle_style)
subtitle3_para = Paragraph("Semester Grade Report / Marksheet", subtitle_style)
subtitle3_para = Paragraph("<b><u>Semester Grade Report / Marksheet</u></b>", subtitle_style)

# Create header table with logo and text
header_table_data = [
Expand All @@ -3523,16 +3524,16 @@ def post(self, request):
story.append(header_table)
else:
# No logo, just text
story.append(Paragraph("PDPM Indian Institute of Information Technology, Design &", title_style))
story.append(Paragraph("Manufacturing, Jabalpur", title_style))
story.append(Paragraph("PDPM Indian Institute of Information Technology,", title_style))
story.append(Paragraph("Design & Manufacturing, Jabalpur", title_style))
story.append(Paragraph("(An Institute of National Importance under MoE, Govt. of India)", subtitle_style))
story.append(Paragraph("Semester Grade Report / Marksheet", subtitle_style))
story.append(Paragraph("<b><u>Semester Grade Report / Marksheet</u></b>", subtitle_style))
except Exception as e:
# If logo fails, continue with text only
story.append(Paragraph("PDPM Indian Institute of Information Technology, Design &", title_style))
story.append(Paragraph("Manufacturing, Jabalpur", title_style))
story.append(Paragraph("PDPM Indian Institute of Information Technology,", title_style))
story.append(Paragraph("Design & Manufacturing, Jabalpur", title_style))
story.append(Paragraph("(An Institute of National Importance under MoE, Govt. of India)", subtitle_style))
story.append(Paragraph("Semester Grade Report / Marksheet", subtitle_style))
story.append(Paragraph("<b><u>Semester Grade Report / Marksheet</u></b>", subtitle_style))

story.append(Spacer(1, 12))

Expand All @@ -3551,7 +3552,7 @@ def post(self, request):
[Paragraph('Semester:', cell_style), Paragraph(formatted_semester, cell_style), Paragraph('Academic Year:', cell_style), Paragraph(student_info.get('academicYear', student_info.get('academic_year', 'N/A')), cell_style)]
]

student_table = Table(student_data, colWidths=[1.75*inch, 1.75*inch, 1.75*inch, 1.75*inch])
student_table = Table(student_data, colWidths=[1.14*inch, 3.56*inch, 1.3*inch, 1.0*inch])
student_table.setStyle(TableStyle([
('FONTNAME', (0, 0), (-1, -1), 'Times-Roman'),
('FONTSIZE', (0, 0), (-1, -1), 10),
Expand Down