I can't download my Files how do I find
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Table, TableStyle
from reportlab.lib.units import inch
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
# File paths
logo_path = “1000776991.webp”
output_path = “PPRI_Code_of_Conduct.pdf”
# Create PDF Document
doc = SimpleDocTemplate(output_path, pagesize=A4,
rightMargin=0.8\*inch, leftMargin=0.8\*inch,
topMargin=0.5\*inch, bottomMargin=0.5\*inch)
story =
styles = getSampleStyleSheet()
# Custom Styles
title_style = ParagraphStyle(
'CustomTitle',
parent=styles\['Title'\],
fontSize=16,
spaceAfter=6,
alignment=TA_CENTER,
textColor=colors.black
)
header_style = ParagraphStyle(
'CustomHeader',
parent=styles\['Heading2'\],
fontSize=12,
spaceBefore=10,
spaceAfter=4,
textColor=colors.black
)
body_style = ParagraphStyle(
'CustomBody',
parent=styles\['Normal'\],
fontSize=11,
leading=14,
alignment=TA_JUSTIFY
)
bullet_style = ParagraphStyle(
'Bullet',
parent=styles\['Normal'\],
fontSize=11,
leading=14,
leftIndent=20,
bulletIndent=10
)
# 1. Add Logo (Centered)
try:
\# Calculate aspect ratio to keep logo proportional
\# Assuming logo is roughly square-ish, let's fit it into 2 inches height/width
im = Image(logo_path, width=2.0\*inch, height=2.0\*inch, kind='proportional')
im.hAlign = 'CENTER'
story.append(im)
story.append(Spacer(1, 12))
except Exception as e:
story.append(Paragraph("\[Logo Placeholder\]", title_style))
# 2. Organization Name & Title
story.append(Paragraph(“PEACE & PROGRESS FOR ROHINGYA IN INDONESIA (PPRI)”, title_style))
story.append(Spacer(1, 4))
story.append(Paragraph(“Code of Conduct for Officers & Team Members”, ParagraphStyle(‘SubTitle’, parent=styles[‘Heading2’], alignment=TA_CENTER)))
story.append(Spacer(1, 12))
# 3. Purpose
story.append(Paragraph(“**Purpose:** This Code of Conduct outlines the standards, responsibilities, and expected behavior of all members, officers, and volunteers serving under Peace & Progress for Rohingya in Indonesia (PPRI). Every member must follow these principles to ensure professionalism, safety, trust, and accountability.”, body_style))
story.append(Spacer(1, 12))
# 4. Sections
sections = [
("1. Commitment to the Organization’s Mission",
"Members must support the mission: peace, education, empowerment, human rights, and community progress. Work for the community with honesty, unity, and respect."),
("2. Respect for Community and Colleagues",
"All members must treat everyone with respect regardless of age, gender, religion, background, or status. Avoid discrimination, harassment, disrespect, or verbal abuse."),
("3. Professional Behavior",
"Members must show discipline, responsibility, and good communication. Attend meetings, trainings, and community activities on time. Maintain confidentiality of sensitive information."),
("4. No Misuse of Authority or Organization Name",
"Members must not misuse the organization’s title, name, or logo for personal benefit. Use their position to influence, threaten, or pressure community members. Do not collect money, gifts, or support without permission from the Executive Director."),
("5. Transparency & Accountability",
"Members must report truthfully on all activities. Use all materials, donations, or support strictly for community benefit. Avoid corruption, dishonesty, or hidden actions."),
("6. Non-Violence & Peacebuilding",
"Every member must promote peaceful solutions. Avoid emotional reactions, fighting, or encouraging anger. Help resolve issues through dialogue and respect."),
("7. Cooperation with Humanitarian Agencies",
"Members must follow guidance from IOM, UNHCR, and local authorities. Support coordination during protection, medical, or emergency matters. Maintain good communication and respect toward humanitarian staff."),
("8. Social Media & Public Communication",
"Members must share accurate information only. Avoid spreading rumors, misinformation, or sensitive content. Seek permission before speaking to media, reporters, or foreign organizations."),
("9. Zero Tolerance for Abuse",
"Strictly prohibited: Physical or verbal abuse, sexual harassment, threatening, bullying, or encouraging illegal activities. Any violation will result in suspension or termination."),
("10. Resignation Policy",
"If a member wants to resign: They must submit an official resignation paper, stop using the organization’s name or position immediately, and return all materials/documents.")
]
for title, content in sections:
story.append(Paragraph(f"<b>{title}</b>", header_style))
story.append(Paragraph(content, body_style))
story.append(Spacer(1, 6))
# 5. Acceptance Section
story.append(Spacer(1, 12))
story.append(Paragraph(“**11. Acceptance of the Code** ”, header_style))
story.append(Paragraph(“All officers and team members must sign the Officer Agreement and confirm that they:”, body_style))
story.append(Paragraph(“• Understand this Code of Conduct”, bullet_style))
story.append(Paragraph(“• Agree to follow it in all activities”, bullet_style))
story.append(Paragraph(“• Accept accountability for their actions”, bullet_style))
story.append(Spacer(1, 24))
# 6. Signatures Table
# Creating a table for signatures to look professional
data = [
\["Officer/Team Member Name:", "\_" \* 35\],
\["Signature:", "\_" \* 35\],
\["Date:", "\_" \* 35\],
\["", ""\], # Spacer row
\["Signature Of Executive Director:", "Alomgir bin Kholilurrahman"\],
\["Date:", "\_" \* 35\]
]
# Style for the table
table_style = TableStyle([
('FONTNAME', (0,0), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 11),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 8),
('ALIGN', (0,0), (0,-1), 'LEFT'), # Labels left aligned
('ALIGN', (1,0), (1,-1), 'LEFT'), # Lines left aligned
('TEXTCOLOR', (1,4), (1,4), colors.black), # Director Name
('FONTNAME', (1,4), (1,4), 'Helvetica-Bold'),
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image, Table, TableStyle
from reportlab.lib.units import inch
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
# File paths
logo_path = “1000776991.webp”
output_path = “PPRI_Code_of_Conduct.pdf”
# Create PDF Document
doc = SimpleDocTemplate(output_path, pagesize=A4,
rightMargin=0.8\*inch, leftMargin=0.8\*inch,
topMargin=0.5\*inch, bottomMargin=0.5\*inch)
story =
styles = getSampleStyleSheet()
# Custom Styles
title_style = ParagraphStyle(
'CustomTitle',
parent=styles\['Title'\],
fontSize=16,
spaceAfter=6,
alignment=TA_CENTER,
textColor=colors.black
)
header_style = ParagraphStyle(
'CustomHeader',
parent=styles\['Heading2'\],
fontSize=12,
spaceBefore=10,
spaceAfter=4,
textColor=colors.black
)
body_style = ParagraphStyle(
'CustomBody',
parent=styles\['Normal'\],
fontSize=11,
leading=14,
alignment=TA_JUSTIFY
)
bullet_style = ParagraphStyle(
'Bullet',
parent=styles\['Normal'\],
fontSize=11,
leading=14,
leftIndent=20,
bulletIndent=10
)
# 1. Add Logo (Centered)
try:
\# Calculate aspect ratio to keep logo proportional
\# Assuming logo is roughly square-ish, let's fit it into 2 inches height/width
im = Image(logo_path, width=2.0\*inch, height=2.0\*inch, kind='proportional')
im.hAlign = 'CENTER'
story.append(im)
story.append(Spacer(1, 12))
except Exception as e:
story.append(Paragraph("\[Logo Placeholder\]", title_style))
# 2. Organization Name & Title
story.append(Paragraph(“PEACE & PROGRESS FOR ROHINGYA IN INDONESIA (PPRI)”, title_style))
story.append(Spacer(1, 4))
story.append(Paragraph(“Code of Conduct for Officers & Team Members”, ParagraphStyle(‘SubTitle’, parent=styles[‘Heading2’], alignment=TA_CENTER)))
story.append(Spacer(1, 12))
# 3. Purpose
story.append(Paragraph(“**Purpose:** This Code of Conduct outlines the standards, responsibilities, and expected behavior of all members, officers, and volunteers serving under Peace & Progress for Rohingya in Indonesia (PPRI). Every member must follow these principles to ensure professionalism, safety, trust, and accountability.”, body_style))
story.append(Spacer(1, 12))
# 4. Sections
sections = [
("1. Commitment to the Organization’s Mission",
"Members must support the mission: peace, education, empowerment, human rights, and community progress. Work for the community with honesty, unity, and respect."),
("2. Respect for Community and Colleagues",
"All members must treat everyone with respect regardless of age, gender, religion, background, or status. Avoid discrimination, harassment, disrespect, or verbal abuse."),
("3. Professional Behavior",
"Members must show discipline, responsibility, and good communication. Attend meetings, trainings, and community activities on time. Maintain confidentiality of sensitive information."),
("4. No Misuse of Authority or Organization Name",
"Members must not misuse the organization’s title, name, or logo for personal benefit. Use their position to influence, threaten, or pressure community members. Do not collect money, gifts, or support without permission from the Executive Director."),
("5. Transparency & Accountability",
"Members must report truthfully on all activities. Use all materials, donations, or support strictly for community benefit. Avoid corruption, dishonesty, or hidden actions."),
("6. Non-Violence & Peacebuilding",
"Every member must promote peaceful solutions. Avoid emotional reactions, fighting, or encouraging anger. Help resolve issues through dialogue and respect."),
("7. Cooperation with Humanitarian Agencies",
"Members must follow guidance from IOM, UNHCR, and local authorities. Support coordination during protection, medical, or emergency matters. Maintain good communication and respect toward humanitarian staff."),
("8. Social Media & Public Communication",
"Members must share accurate information only. Avoid spreading rumors, misinformation, or sensitive content. Seek permission before speaking to media, reporters, or foreign organizations."),
("9. Zero Tolerance for Abuse",
"Strictly prohibited: Physical or verbal abuse, sexual harassment, threatening, bullying, or encouraging illegal activities. Any violation will result in suspension or termination."),
("10. Resignation Policy",
"If a member wants to resign: They must submit an official resignation paper, stop using the organization’s name or position immediately, and return all materials/documents.")
]
for title, content in sections:
story.append(Paragraph(f"<b>{title}</b>", header_style))
story.append(Paragraph(content, body_style))
story.append(Spacer(1, 6))
# 5. Acceptance Section
story.append(Spacer(1, 12))
story.append(Paragraph(“**11. Acceptance of the Code** ”, header_style))
story.append(Paragraph(“All officers and team members must sign the Officer Agreement and confirm that they:”, body_style))
story.append(Paragraph(“• Understand this Code of Conduct”, bullet_style))
story.append(Paragraph(“• Agree to follow it in all activities”, bullet_style))
story.append(Paragraph(“• Accept accountability for their actions”, bullet_style))
story.append(Spacer(1, 24))
# 6. Signatures Table
# Creating a table for signatures to look professional
data = [
\["Officer/Team Member Name:", "\_" \* 35\],
\["Signature:", "\_" \* 35\],
\["Date:", "\_" \* 35\],
\["", ""\], # Spacer row
\["Signature Of Executive Director:", "Alomgir bin Kholilurrahman"\],
\["Date:", "\_" \* 35\]
]
# Style for the table
table_style = TableStyle([
('FONTNAME', (0,0), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 11),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 8),
('ALIGN', (0,0), (0,-1), 'LEFT'), # Labels left aligned
('ALIGN', (1,0), (1,-1), 'LEFT'), # Lines left aligned
('TEXTCOLOR', (1,4), (1,4), colors.black), # Director Name
('FONTNAME', (1,4), (1,4), 'Helvetica-Bold'),
# Bold Director Name
])
t = Table(data, colWidths=[2.5*inch, 3.5*inch])
t.setStyle(table_style)
story.append(t)
# Build PDF
doc.build(story) # Bold Director Name
])
t = Table(data, colWidths=[2.5*inch, 3.5*inch])
t.setStyle(table_style)
story.append(t)
# Build PDF
doc.build(story)