🦀 ClawHub
Ppt Light Corporate
by @ksfrist
Generate polished corporate PPTs using a light-themed company template. Activate when: (1) User asks to create/make/generate a PPT/PowerPoint/幻灯片/演示文稿 (2) Us...
💡 Examples
import sys
sys.path.insert(0, '/scripts')
from ppt_helpers import TemplateBuildertb = TemplateBuilder()
s = tb.add_cover_slide()
tb.text(s, 0.8, 1.5, 8.4, 0.6, '标题', sz=32, color=tb.RED2, bold=True)
s = tb.add_content_slide('页面标题')
tb.three_col_icon_cards(s, [
{'icon_text': '', 'title': '功能一', 'body': '说明'},
{'icon_text': '', 'title': '功能二', 'body': '说明'},
{'icon_text': '', 'title': '功能三', 'body': '说明'},
])
放置白色矢量图标到红色圆圈上(自动检测圆圈位置)
def find_circles(slide):
circles = []
for shape in slide.shapes:
if 'Oval' in shape.name:
x, y = shape.left / 914400, shape.top / 914400
w, h = shape.width / 914400, shape.height / 914400
circles.append({'cx': x + w/2, 'cy': y + h/2, 'w': w})
return circlesfor circle, query in zip(find_circles(s), ['server', 'wifi', 'database']):
sz = circle['w'] * 0.55
tb.place_icon(s, query, circle['cx'] - sz/2, circle['cy'] - sz/2, size=sz, color='FFFFFF')
tb.save('output.pptx')
TERMINAL
clawhub install ppt-light-corporate