Loading...
Loading...
Compare original and translation side by side
undefinedundefinedundefinedundefinedpython ooxml/scripts/unpack.py <office_file> <output_dir>skills/pptx/ooxml/scripts/unpack.pyfind . -name "unpack.py"python ooxml/scripts/unpack.py <office_file> <output_dir>skills/pptx/ooxml/scripts/unpack.pyfind . -name "unpack.py"ppt/presentation.xmlppt/slides/slide{N}.xmlppt/notesSlides/notesSlide{N}.xmlppt/comments/modernComment_*.xmlppt/slideLayouts/ppt/slideMasters/ppt/theme/ppt/media/ppt/presentation.xmlppt/slides/slide{N}.xmlppt/notesSlides/notesSlide{N}.xmlppt/comments/modernComment_*.xmlppt/slideLayouts/ppt/slideMasters/ppt/theme/ppt/media/ppt/theme/theme1.xml<a:clrScheme><a:fontScheme>ppt/slides/slide1.xml<a:rPr><a:solidFill><a:srgbClr>ppt/theme/theme1.xml<a:clrScheme><a:fontScheme>ppt/slides/slide1.xml<a:rPr><a:solidFill><a:srgbClr>html2pptx.md<p><h1><h6><ul><ol>class="placeholder"html2pptx.jshtml2pptx()pptx.writeFile()python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4html2pptx.md<p><h1><h6><ul><ol>class="placeholder"html2pptx.jshtml2pptx()pptx.writeFile()python scripts/thumbnail.py output.pptx workspace/thumbnails --cols 4ooxml.mdpython ooxml/scripts/unpack.py <office_file> <output_dir>ppt/slides/slide{N}.xmlpython ooxml/scripts/validate.py <dir> --original <file>python ooxml/scripts/pack.py <input_directory> <office_file>ooxml.mdpython ooxml/scripts/unpack.py <office_file> <output_dir>ppt/slides/slide{N}.xmlpython ooxml/scripts/validate.py <dir> --original <file>python ooxml/scripts/pack.py <input_directory> <office_file>python -m markitdown template.pptx > template-content.mdtemplate-content.mdpython scripts/thumbnail.py template.pptxtemplate-inventory.md# Template Inventory Analysis
**Total Slides: [count]**
**IMPORTANT: Slides are 0-indexed (first slide = 0, last slide = count-1)**
## [Category Name]
- Slide 0: [Layout code if available] - Description/purpose
- Slide 1: [Layout code] - Description/purpose
- Slide 2: [Layout code] - Description/purpose
[... EVERY slide must be listed individually with its index ...]outline.md# Template slides to use (0-based indexing)
# WARNING: Verify indices are within range! Template with 73 slides has indices 0-72
# Mapping: slide numbers from outline -> template slide indices
template_mapping = [
0, # Use slide 0 (Title/Cover)
34, # Use slide 34 (B1: Title and body)
34, # Use slide 34 again (duplicate for second B1)
50, # Use slide 50 (E1: Quote)
54, # Use slide 54 (F2: Closing + Text)
]rearrange.pyscripts/rearrange.pypython scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52inventory.pypython scripts/inventory.py working.pptx text-inventory.json {
"slide-0": {
"shape-0": {
"placeholder_type": "TITLE", // or null for non-placeholders
"left": 1.5, // position in inches
"top": 2.0,
"width": 7.5,
"height": 1.2,
"paragraphs": [
{
"text": "Paragraph text",
// Optional properties (only included when non-default):
"bullet": true, // explicit bullet detected
"level": 0, // only included when bullet is true
"alignment": "CENTER", // CENTER, RIGHT (not LEFT)
"space_before": 10.0, // space before paragraph in points
"space_after": 6.0, // space after paragraph in points
"line_spacing": 22.4, // line spacing in points
"font_name": "Arial", // from first run
"font_size": 14.0, // in points
"bold": true,
"italic": false,
"underline": false,
"color": "FF0000" // RGB color
}
]
}
}
}default_font_sizebullet: truelevelspace_beforespace_afterline_spacingcolortheme_coloralignment"bullet": true"bold": true"bullet": true, "level": 0"alignment": "CENTER""font_size": 14.0"font_name": "Lora""color": "FF0000""theme_color": "DARK_1"replacement-text.json"paragraphs": [
{
"text": "New presentation title text",
"alignment": "CENTER",
"bold": true
},
{
"text": "Section Header",
"bold": true
},
{
"text": "First bullet point without bullet symbol",
"bullet": true,
"level": 0
},
{
"text": "Red colored text",
"color": "FF0000"
},
{
"text": "Theme colored text",
"theme_color": "DARK_1"
},
{
"text": "Regular paragraph text without special formatting"
}
]{
"slide-0": {
"shape-0": {
"paragraphs": [...] // This shape gets new text
}
// shape-1 and shape-2 from inventory will be cleared automatically
}
}"bullet": true, "level": 0replace.pypython scripts/replace.py working.pptx replacement-text.json output.pptxERROR: Invalid shapes in replacement JSON:
- Shape 'shape-99' not found on 'slide-0'. Available shapes: shape-0, shape-1, shape-4
- Slide 'slide-999' not found in inventoryERROR: Replacement text made overflow worse in these shapes:
- slide-0/shape-2: overflow worsened by 1.25" (was 0.00", now 1.25")python -m markitdown template.pptx > template-content.mdtemplate-content.mdpython scripts/thumbnail.py template.pptxtemplate-inventory.md# 模板清单分析
**总幻灯片数: [数量]**
**重要提示: 幻灯片采用0索引(第一张幻灯片=0,最后一张=数量-1)**
## [分类名称]
- Slide 0: [布局代码(如有)] - 描述/用途
- Slide 1: [布局代码] - 描述/用途
- Slide 2: [布局代码] - 描述/用途
[... 必须逐一列出每一张幻灯片及其索引 ...]outline.md# 要使用的模板幻灯片(0索引)
# 警告: 请验证索引在有效范围内!包含73张幻灯片的模板索引范围是0-72
# 映射: 大纲中的幻灯片编号 -> 模板幻灯片索引
template_mapping = [
0, # 使用Slide 0(标题/封面)
34, # 使用Slide 34(B1: 标题与正文)
34, # 再次使用Slide 34(复制第二张B1布局幻灯片)
50, # 使用Slide 50(E1: 引用)
54, # 使用Slide 54(F2: 结尾+文本)
]rearrange.pyscripts/rearrange.pypython scripts/rearrange.py template.pptx working.pptx 0,34,34,50,52inventory.pypython scripts/inventory.py working.pptx text-inventory.json {
"slide-0": {
"shape-0": {
"placeholder_type": "TITLE", // or null for non-placeholders
"left": 1.5, // 位置(英寸)
"top": 2.0,
"width": 7.5,
"height": 1.2,
"paragraphs": [
{
"text": "Paragraph text",
// 可选属性(仅当非默认值时包含):
"bullet": true, // 检测到显式项目符号
"level": 0, // 仅当bullet为true时包含
"alignment": "CENTER", // CENTER、RIGHT(LEFT不包含)
"space_before": 10.0, // 段落前间距(磅)
"space_after": 6.0, // 段落后间距(磅)
"line_spacing": 22.4, // 行间距(磅)
"font_name": "Arial", // 取自第一个文本块
"font_size": 14.0, // 磅
"bold": true,
"italic": false,
"underline": false,
"color": "FF0000" // RGB颜色
}
]
}
}
}default_font_sizebullet: truelevelspace_beforespace_afterline_spacingcolortheme_color"bullet": truealignment"bold": true"bullet": true, "level": 0"alignment": "CENTER""font_size": 14.0"font_name": "Lora""color": "FF0000""theme_color": "DARK_1"replacement-text.json"paragraphs": [
{
"text": "新演示文稿标题文本",
"alignment": "CENTER",
"bold": true
},
{
"text": "章节标题",
"bold": true
},
{
"text": "不带项目符号符号的第一个项目符号项",
"bullet": true,
"level": 0
},
{
"text": "红色文本",
"color": "FF0000"
},
{
"text": "主题颜色文本",
"theme_color": "DARK_1"
},
{
"text": "无特殊格式的常规段落文本"
}
]{
"slide-0": {
"shape-0": {
"paragraphs": [...] // 该形状会被设置新文本
}
// 清单中的shape-1和shape-2会被自动清空
}
}"bullet": true, "level": 0replace.pypython scripts/replace.py working.pptx replacement-text.json output.pptxERROR: 替换JSON中存在无效形状:
- 'slide-0'上未找到'shape-99'形状。可用形状: shape-0, shape-1, shape-4
- 清单中未找到'slide-999'幻灯片ERROR: 以下形状的替换文本导致内容溢出更严重:
- slide-0/shape-2: 溢出增加了1.25英寸(原0.00英寸,现1.25英寸)python scripts/thumbnail.py template.pptx [output_prefix]thumbnails.jpgthumbnails-1.jpgthumbnails-2.jpgpython scripts/thumbnail.py template.pptx my-gridworkspace/my-grid--cols 4undefinedpython scripts/thumbnail.py template.pptx [output_prefix]thumbnails.jpgthumbnails-1.jpgthumbnails-2.jpgpython scripts/thumbnail.py template.pptx my-gridworkspace/my-grid--cols 4undefinedundefinedundefinedsoffice --headless --convert-to pdf template.pptxpdftoppm -jpeg -r 150 template.pdf slideslide-1.jpgslide-2.jpg-r 150-jpeg-png-f N-f 2-l N-l 5slidepdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide # Converts only pages 2-5soffice --headless --convert-to pdf template.pptxpdftoppm -jpeg -r 150 template.pdf slideslide-1.jpgslide-2.jpg-r 150-jpeg-png-f N-f 2-l N-l 5slidepdftoppm -jpeg -r 150 -f 2 -l 5 template.pdf slide # 仅转换第2-5页pip install "markitdown[pptx]"npm install -g pptxgenjsnpm install -g playwrightnpm install -g react-icons react react-domnpm install -g sharpsudo apt-get install libreofficesudo apt-get install poppler-utilspip install defusedxmlpip install "markitdown[pptx]"npm install -g pptxgenjsnpm install -g playwrightnpm install -g react-icons react react-domnpm install -g sharpsudo apt-get install libreofficesudo apt-get install poppler-utilspip install defusedxml