-
Notifications
You must be signed in to change notification settings - Fork 659
Description
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.shapes import MSO_SHAPE
from pptx.dml.color import RGBColor
from pptx.enum.shapes import MSO_AUTO_SHAPE_TYPE
from pptx.enum.transition import PP_TRANSITION
import os
Create presentation
prs = Presentation()
prs.slide_width = Inches(13.33)
prs.slide_height = Inches(7.5)
Define colors
gold = RGBColor(212, 175, 55)
black = RGBColor(0, 0, 0)
blue = RGBColor(0, 112, 192)
Titles for 14 slides
titles = [
"مقدمة عن برنامج الولاء",
"أهداف البرنامج",
"الفئة المستهدفة",
"آلية التسجيل",
"مزايا الأعضاء",
"نظام النقاط",
"مستويات الولاء",
"الشراكات التجارية",
"التسويق والترويج",
"التحفيز والمكافآت",
"التحليل والبيانات",
"التكامل التقني",
"خطة التنفيذ",
"الختام والدعوة للعمل"
]
Add slides with design
for i, title in enumerate(titles):
slide_layout = prs.slide_layouts[6] # Blank layout
slide = prs.slides.add_slide(slide_layout)
# Title box
title_box = slide.shapes.add_textbox(Inches(0.5), Inches(0.3), Inches(12.5), Inches(1))
title_frame = title_box.text_frame
title_frame.text = title
title_frame.paragraphs[0].font.size = Pt(44)
title_frame.paragraphs[0].font.bold = True
title_frame.paragraphs[0].font.color.rgb = gold
# Content box
content_box = slide.shapes.add_textbox(Inches(1), Inches(1.5), Inches(11.5), Inches(5.5))
content_frame = content_box.text_frame
content_frame.text = f"محتوى الشريحة رقم {i+1} يتم إدراجه هنا حسب القائمة التنفيذية وخريطة الصور."
content_frame.paragraphs[0].font.size = Pt(28)
content_frame.paragraphs[0].font.color.rgb = black
# Add placeholder for image
slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, Inches(10), Inches(1.5), Inches(2.5), Inches(2.5)).text = "صورة"
# Add icon placeholder
slide.shapes.add_shape(MSO_SHAPE.OVAL, Inches(0.5), Inches(6.5), Inches(1), Inches(1)).text = "أيقونة"
Save presentation
output_path = "/mnt/data/Loyalty_Program_Final_Presentation.pptx"
prs.save(output_path)
print("تم إنشاء العرض التقديمي النهائي بنجاح.")