zcbot/skills/ppt/references/canvas_presets.md

56 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 画布尺寸预设
> 阶段一选画布时查这张表。**画布定了之后所有版式按这个尺寸算坐标**,不要中途改。
## 标准尺寸表
| 用途 | 比例 | 宽×高 (英寸) | python-pptx | 说明 |
|-----|------|------------|------------|------|
| **现代商务汇报** | 16:9 | 13.33 × 7.5 | `Inches(13.33), Inches(7.5)` | **默认选这个** |
| 老投影仪 | 4:3 | 10 × 7.5 | `Inches(10), Inches(7.5)` | 老会议室、教学场景 |
| 竖屏手机 / 朋友圈 | 9:16 | 7.5 × 13.33 | `Inches(7.5), Inches(13.33)` | 移动端阅读、视频号封面 |
| 小红书 | 3:4 | 7.5 × 10 | `Inches(7.5), Inches(10)` | 单图阅读 |
| 微信公众号长图 | 1:n | 7.5 × 7.5 起 | `Inches(7.5), Inches(7.5)` | 单页或拼接 |
| 海报 (A4 横) | √2:1 | 11.69 × 8.27 | `Inches(11.69), Inches(8.27)` | 打印 |
| 海报 (A4 竖) | 1:√2 | 8.27 × 11.69 | `Inches(8.27), Inches(11.69)` | 打印 |
| 大屏宣讲 | 16:9 高 dpi | 同 16:9 | 同上 | 字号上调 4-6pt |
## 选画布的几条经验
- 不知道选哪个 —— **16:9**,99% 场合通吃
- 用户在投影仪墙上看 —— 16:9
- 用户在电脑屏幕上看 —— 16:9 或 4:3
- 用户在手机上看 —— 9:16
- 用户要打印散发 —— A4 横或 A4 竖
- 用户说"做个图发朋友圈" —— 3:4 或 1:1,不是 PPT 范畴但 python-pptx 也能干
## python-pptx 画布初始化
```python
from pptx import Presentation
from pptx.util import Inches, Pt
prs = Presentation()
# 16:9 默认
prs.slide_width = Inches(13.33)
prs.slide_height = Inches(7.5)
# 4:3 改这两行
# prs.slide_width = Inches(10)
# prs.slide_height = Inches(7.5)
# 9:16 改这两行
# prs.slide_width = Inches(7.5)
# prs.slide_height = Inches(13.33)
```
## 安全边距 (各画布通用)
- 左右边距: **画布宽 × 0.05** (16:9 即 0.67 寸)
- 上下边距: **画布高 × 0.07** (16:9 即 0.5 寸)
- 内容区域: 画布尺寸减去四周边距,所有元素都摆在这个矩形内
## 字号随画布缩放
如果画布超过 16:9 默认尺寸 (比如做 4K 大屏),**所有字号 × (实际宽 / 13.33)**。模型自己换算,不要硬抄默认表。