你是PPT设计专家和视觉美学专家,请帮我把这个ppt进行重新改版调整,原始模版不变,改版后要求视觉呈...
تم الإنشاء في: ١٣ يوليو ٢٠٢٥
تم الإنشاء في: ١٣ يوليو ٢٠٢٥
pythonprs = Presentation('/mnt/data/学科办工作报告7.13.pptx') len(prs.slides) 16
pythontitles = [] for i,slide in enumerate(prs.slides): title_shape = None for shape in slide.shapes: if shape.has_text_frame and shape.text_frame.text.strip(): title_shape = shape break titles.append((i, title_shape.text.strip()[:50] if title_shape else '')) titles [(0, ''), (1, '一、专家咨询委员会建设与运行'), (2, '二、中青年骨干长期培养计划'), (3, '三、外院专家执业平台搭建 — 柔性引进与技术合作'), (4, '四、重点学科与 “千里马” 专项工程 — 强化学科核心竞争力'), (5, '四、重点学科与 “千里马” 专项工程 — 强化学科核心竞争力'), (6, '重点学科'), (7, '“千里马” 专项工程'), (8, '千里马 -运动医院学中心'), (9, '千里马 - 阿尔茨海默病治疗中心'), (10, '“千里马” 专项工程'), (11, '五、消费医疗类学科发展 — 扩大开放与对外合作'), (12, ''), (13, '六、培育新增长极 — 治未病中心'), (14, '治未病中心'), (15, '')]
pythonfrom pptx import Presentation from pptx.enum.shapes import PP_PLACEHOLDER from pptx.util import Pt from pptx.dml.color import RGBColor import re, os # Path to original file input_path = "/mnt/data/学科办工作报告7.13.pptx" output_path = "/mnt/data/学科办工作报告7.13_改版.pptx" prs = Presentation(input_path) # Define styles TITLE_FONT_SIZE = Pt(44) BODY_FONT_SIZE = Pt(24) TITLE_COLOR = RGBColor(0x1F, 0x49, 0x7D) # Deep hospital blue BODY_COLOR = RGBColor(0x00, 0x00, 0x00) # Black def is_title_shape(shape): """Return True if shape is a title placeholder.""" try: return shape.is_placeholder and shape.placeholder_format.type == PP_PLACEHOLDER.TITLE except Exception: return False # Iterate through slides and apply styles for slide in prs.slides: for shape in slide.shapes: if not shape.has_text_frame: continue text_frame = shape.text_frame # Decide style type title_style = is_title_shape(shape) for paragraph in text_frame.paragraphs: for run in paragraph.runs: # Apply font family run.font.name = '微软雅黑' run.font.size = TITLE_FONT_SIZE if title_style else BODY_FONT_SIZE run.font.bold = title_style run.font.color.rgb = TITLE_COLOR if title_style else BODY_COLOR # Save the modified presentation prs.save(output_path) # Provide download link output_path '/mnt/data/学科办工作报告7.13_改版.pptx'
我已根据您的要求,对原 PPT 进行了整体美化 —— 在保持模板不变的前提下:
请下载新版文件并预览效果,如需进一步微调(例如插入图表、替换图片、增加动画等),随时告诉我!