lark-slides

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

slides (v1)

slides (v1)

CRITICAL — 开始前 MUST 先用 Read 工具读取
../lark-shared/SKILL.md
,其中包含认证、权限处理
CRITICAL — 生成任何 XML 之前,MUST 先用 Read 工具读取 xml-schema-quick-ref.md,禁止凭记忆猜测 XML 结构。
CRITICAL — You MUST use the Read tool to read
../lark-shared/SKILL.md
before starting, which contains authentication and permission handling rules
CRITICAL — Before generating any XML, you MUST use the Read tool to read xml-schema-quick-ref.md. Guessing XML structure from memory is strictly prohibited.

身份选择

Identity Selection

飞书幻灯片通常是用户自己的内容资源。默认应优先显式使用
--as user
(用户身份)执行 slides 相关操作
,始终显式指定身份。
  • --as user
    (推荐)
    :以当前登录用户身份创建、读取、管理演示文稿。执行前先完成用户授权:
bash
lark-cli auth login --domain slides
  • --as bot
    :仅在用户明确要求以应用身份操作,或需要让 bot 持有/创建资源时使用。使用 bot 身份时,要额外确认 bot 是否真的有目标演示文稿的访问权限。
执行规则
  1. 创建、读取、增删 slide、按用户给出的链接继续编辑已有 PPT,默认都先用
    --as user
  2. 如果出现权限不足,先检查当前是否误用了 bot 身份;不要默认回退到 bot。
  3. 只有在用户明确要求“用应用身份 / bot 身份操作”,或当前工作流就是 bot 创建资源后再做协作授权时,才切换到
    --as bot
Lark Slides are usually the user's own content resources. By default, you should explicitly use
--as user
(user identity) to perform slides-related operations first
, always specify the identity explicitly.
  • --as user
    (Recommended)
    : Create, read, and manage presentations as the currently logged-in user. Complete user authorization before execution:
bash
lark-cli auth login --domain slides
  • --as bot
    : Only used when the user explicitly requires operation as the application identity, or when the bot needs to hold/create resources. When using the bot identity, additionally confirm whether the bot actually has access permission to the target presentation.
Execution Rules:
  1. For creation, reading, adding/deleting slides, and continuing to edit existing PPT according to the link provided by the user, use
    --as user
    by default first.
  2. If there is insufficient permission, first check whether the bot identity is misused currently; do not fall back to bot by default.
  3. Only switch to
    --as bot
    when the user explicitly requires "operation with application identity / bot identity", or the current workflow is that the bot creates resources and then grants collaboration authorization.

快速开始

Quick Start

一条命令创建包含页面内容的 PPT(推荐):
bash
lark-cli slides +create --title "演示文稿标题" --slides '[
  "<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><style><fill><fillColor color=\"rgb(245,245,245)\"/></fill></style><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"100\"><content textType=\"title\"><p>页面标题</p></content></shape><shape type=\"text\" topLeftX=\"80\" topLeftY=\"200\" width=\"800\" height=\"200\"><content textType=\"body\"><p>正文内容</p><ul><li><p>要点一</p></li><li><p>要点二</p></li></ul></content></shape></data></slide>"
]'
也可以分两步(先创建空白 PPT,再逐页添加),详见 +create 参考文档
以上是最小可用示例。更丰富的页面效果(渐变背景、卡片、图表、表格等),参考下方 Workflow 和 XML 模板。
Create a PPT with page content in one command (Recommended):
bash
lark-cli slides +create --title "Presentation Title" --slides '[
  "<slide xmlns=\"http://www.larkoffice.com/sml/2.0\"><style><fill><fillColor color=\"rgb(245,245,245)\"/></fill></style><data><shape type=\"text\" topLeftX=\"80\" topLeftY=\"80\" width=\"800\" height=\"100\"><content textType=\"title\"><p>Page Title</p></content></shape><shape type=\"text\" topLeftX=\"80\" topLeftY=\"200\" width=\"800\" height=\"200\"><content textType=\"body\"><p>Body Content</p><ul><li><p>Key Point 1</p></li><li><p>Key Point 2</p></li></ul></content></shape></data></slide>"
]'
You can also do it in two steps (create a blank PPT first, then add pages one by one), see +create reference document for details.
The above is the minimum usable example. For richer page effects (gradient background, cards, charts, tables, etc.), refer to the Workflow and XML templates below.

执行前必做

Must-do Before Execution

重要
references/slides_xml_schema_definition.xml
是此 skill 唯一正确的 XML 协议来源;其他 md 仅是对它和 CLI schema 的摘要。
Important:
references/slides_xml_schema_definition.xml
is the only correct source of XML protocol for this skill; other md files are only summaries of it and the CLI schema.

必读(每次创建前)

Required Reading (Before Each Creation)

文档说明
xml-schema-quick-ref.mdXML 元素和属性速查,必读
DocumentDescription
xml-schema-quick-ref.mdXML element and attribute quick reference, mandatory reading

选读(需要时查阅)

Optional Reading (Check When Needed)

场景文档
需要了解详细 XML 结构xml-format-guide.md
需要 CLI 调用示例examples.md
需要参考真实 PPT 的 XMLslides_demo.xml
需要用 table/chart 等复杂元素slides_xml_schema_definition.xml(完整 Schema)
需要了解某个命令的详细参数对应命令的 reference 文档(见下方参考文档章节)
ScenarioDocument
Need to understand detailed XML structurexml-format-guide.md
Need CLI call examplesexamples.md
Need to refer to XML of real PPTslides_demo.xml
Need to use complex elements such as table/chartslides_xml_schema_definition.xml (complete Schema)
Need to understand detailed parameters of a commandReference document for the corresponding command (see the reference document section below)

Workflow

Workflow

这是演示文稿,不是文档。 每页 slide 是独立的视觉画面,信息密度要低,排版要留白。
text
Step 1: 需求澄清 & 读取知识
  - 澄清用户需求:主题、受众、页数、风格偏好
  - 如果用户没有明确风格,根据主题推荐(见下方风格判断表)
  - 读取 XML Schema 参考:
    · xml-schema-quick-ref.md — 元素和属性速查
    · xml-format-guide.md — 详细结构与示例
    · slides_demo.xml — 真实 XML 示例

Step 2: 生成大纲 → 用户确认 → 创建
  - 生成结构化大纲(每页标题 + 要点 + 布局描述),交给用户确认
  - 10 页以内:用 slides +create --slides '[...]' 一步创建 PPT 并添加所有页面
  - 超过 10 页:先 `slides +create` 创建空白 PPT,再用 `xml_presentation.slide.create` 逐页添加
  - 每页 slide 需要完整的 XML:背景、文本、图形、配色
  - 复杂元素(table、chart)需参考 XSD 原文

Step 3: 审查 & 交付
  - 创建完成后,用 xml_presentations.get 读取全文 XML,确认:
    · 页数是否正确?每页内容是否完整?
    · 配色是否统一?字号层级是否合理?
  - 有问题 → 用 xml_presentation.slide.delete 删除问题页,重新创建
  - 没问题 → 交付:告知用户演示文稿 ID 和访问方式
This is a presentation, not a document. Each slide is an independent visual page, with low information density and sufficient white space in typesetting.
text
Step 1: Requirement clarification & knowledge reading
  - Clarify user requirements: theme, audience, number of pages, style preference
  - If the user has no clear style, recommend according to the theme (see the style judgment table below)
  - Read XML Schema reference:
    · xml-schema-quick-ref.md — Element and attribute quick reference
    · xml-format-guide.md — Detailed structure and examples
    · slides_demo.xml — Real XML example

Step 2: Generate outline → user confirmation → creation
  - Generate a structured outline (title per page + key points + layout description), submit to the user for confirmation
  - Less than 10 pages: Use slides +create --slides '[...]' to create PPT and add all pages in one step
  - More than 10 pages: First use `slides +create` to create a blank PPT, then use `xml_presentation.slide.create` to add pages one by one
  - Each slide requires complete XML: background, text, graphics, color scheme
  - Complex elements (table, chart) need to refer to the original XSD

Step 3: Review & delivery
  - After creation, use xml_presentations.get to read the full text XML, confirm:
    · Is the number of pages correct? Is the content of each page complete?
    · Is the color scheme unified? Is the font size hierarchy reasonable?
  - If there is a problem → Use xml_presentation.slide.delete to delete the problematic page and recreate it
  - No problem → Delivery: Inform the user of the presentation ID and access method

jq 命令模板(编辑已有 PPT 时使用)

jq Command Template (Used When Editing Existing PPT)

新建 PPT 推荐用
+create --slides
。以下 jq 模板适用于向已有演示文稿追加页面的场景,可以避免手动转义双引号:
bash
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
  <style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
  <data>
    在这里放置 shape、line、table、chart 等元素
  </data>
</slide>' '{slide:{content:$content}}')"
It is recommended to use
+create --slides
for new PPTs. The following jq template is suitable for scenarios where pages are appended to existing presentations, which can avoid manually escaping double quotes:
bash
lark-cli slides xml_presentation.slide create \
  --as user \
  --params '{"xml_presentation_id":"YOUR_ID"}' \
  --data "$(jq -n --arg content '<slide xmlns="http://www.larkoffice.com/sml/2.0">
  <style><fill><fillColor color="BACKGROUND_COLOR"/></fill></style>
  <data>
    Place elements such as shape, line, table, chart here
  </data>
</slide>' '{slide:{content:$content}}')"

风格快速判断表

Quick Style Reference Table

注意:渐变色必须使用
rgba()
格式并带百分比停靠点,如
linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)
。使用
rgb()
或省略停靠点会导致服务端回退为白色。
场景/主题推荐风格背景主色文字色
科技/AI/产品深色科技风深蓝渐变
linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)
蓝色系
rgb(59,130,246)
白色
商务汇报/季度总结浅色商务风浅灰
rgb(248,250,252)
深蓝
rgb(30,60,114)
深灰
rgb(30,41,59)
教育/培训清新明亮风白色
rgb(255,255,255)
绿色系
rgb(34,197,94)
深灰
rgb(51,65,85)
创意/设计渐变活力风紫粉渐变
linear-gradient(135deg,rgba(88,28,135,1) 0%,rgba(190,24,93,1) 100%)
粉紫色系白色
周报/日常汇报简约专业风浅灰
rgb(248,250,252)
+ 顶部彩色渐变条
蓝色
rgb(59,130,246)
深色
rgb(15,23,42)
用户未指定默认简约专业风同上同上同上
Note: Gradient colors must use
rgba()
format with percentage stop points, such as
linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)
. Using
rgb()
or omitting stop points will cause the server to fall back to white.
Scenario/ThemeRecommended StyleBackgroundPrimary ColorText Color
Technology/AI/ProductDark technology styleDark blue gradient
linear-gradient(135deg,rgba(15,23,42,1) 0%,rgba(56,97,140,1) 100%)
Blue series
rgb(59,130,246)
White
Business report/Quarterly summaryLight business styleLight gray
rgb(248,250,252)
Dark blue
rgb(30,60,114)
Dark gray
rgb(30,41,59)
Education/TrainingFresh and bright styleWhite
rgb(255,255,255)
Green series
rgb(34,197,94)
Dark gray
rgb(51,65,85)
Creative/DesignGradient dynamic stylePurple-pink gradient
linear-gradient(135deg,rgba(88,28,135,1) 0%,rgba(190,24,93,1) 100%)
Pink-purple seriesWhite
Weekly report/Daily reportSimple professional styleLight gray
rgb(248,250,252)
+ top color gradient bar
Blue
rgb(59,130,246)
Dark color
rgb(15,23,42)
User not specifiedDefault simple professional styleSame as aboveSame as aboveSame as above

页面布局建议

Page Layout Suggestions

页面类型布局要点
封面页居中大标题 + 副标题 + 底部信息,背景用渐变或深色
数据概览页指标卡片横排(rect 背景 + 大号数字 + 小号说明),下方列表或图表
内容页左侧竖线装饰 + 标题,下方分栏或列表
对比/表格页table 元素或并列卡片,表头深色背景白字
图表页chart 元素(column/line/pie),配合文字说明
结尾页居中感谢语 + 装饰线,风格与封面呼应
Page TypeLayout Key Points
Cover pageCentered large title + subtitle + bottom information, use gradient or dark background
Data overview pageIndicator cards arranged horizontally (rect background + large number + small description), list or chart below
Content pageLeft vertical line decoration + title, columns or list below
Comparison/Table pagetable element or side-by-side cards, dark background with white text for table header
Chart pagechart element (column/line/pie), with text description
Closing pageCentered thank you message + decorative line, style echoes the cover page

大纲模板

Outline Template

生成大纲时使用以下格式,交给用户确认:
text
[PPT 标题] — [定位描述],面向 [目标受众]

页面结构(N 页):
1. 封面页:[标题文案]
2. [页面主题]:[要点1]、[要点2]、[要点3]
3. [页面主题]:[要点描述]
...
N. 结尾页:[结尾文案]

风格:[配色方案],[排版风格]
Use the following format when generating an outline, submit to the user for confirmation:
text
[PPT Title] — [Positioning Description], for [Target Audience]

Page Structure (N pages):
1. Cover page: [Title copy]
2. [Page theme]: [Key point 1], [Key point 2], [Key point 3]
3. [Page theme]: [Key point description]
...
N. Closing page: [Closing copy]

Style: [Color scheme], [Typesetting style]

常用 Slide XML 模板

Common Slide XML Templates

可直接复制使用的模板(封面页、内容页、数据卡片页、结尾页):slide-templates.md

Templates that can be copied directly (cover page, content page, data card page, closing page): slide-templates.md

核心概念

Core Concepts

URL 格式与 Token

URL Format and Token

URL 格式示例Token 类型处理方式
/slides/
https://example.larkoffice.com/slides/xxxxxxxxxxxxx
xml_presentation_id
URL 路径中的 token 直接作为
xml_presentation_id
使用
/wiki/
https://example.larkoffice.com/wiki/wikcnxxxxxxxxx
wiki_token
⚠️ 不能直接使用,需要先查询获取真实的
obj_token
URL FormatExampleToken TypeProcessing Method
/slides/
https://example.larkoffice.com/slides/xxxxxxxxxxxxx
xml_presentation_id
The token in the URL path is directly used as
xml_presentation_id
/wiki/
https://example.larkoffice.com/wiki/wikcnxxxxxxxxx
wiki_token
⚠️ Cannot be used directly, you need to query first to get the real
obj_token

Wiki 链接特殊处理(关键!)

Special Handling for Wiki Links (Critical!)

知识库链接(
/wiki/TOKEN
)背后可能是云文档、电子表格、幻灯片等不同类型的文档。不能直接假设 URL 中的 token 就是
xml_presentation_id
,必须先查询实际类型和真实 token。
The knowledge base link (
/wiki/TOKEN
) may correspond to different types of documents such as cloud documents, spreadsheets, slides, etc. You cannot directly assume that the token in the URL is
xml_presentation_id
, you must first query the actual type and real token.

处理流程

Processing Flow

  1. 使用
    wiki.spaces.get_node
    查询节点信息
    bash
    lark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'
  2. 从返回结果中提取关键信息
    • node.obj_type
      :文档类型,幻灯片对应
      slides
    • node.obj_token
      真实的演示文稿 token(用于后续操作)
    • node.title
      :文档标题
  3. 确认
    obj_type
    slides
    后,使用
    obj_token
    作为
    xml_presentation_id
  1. Use
    wiki.spaces.get_node
    to query node information
bash
lark-cli wiki spaces get_node --as user --params '{"token":"wiki_token"}'
  1. Extract key information from the returned result
    • node.obj_type
      : Document type, slides correspond to
      slides
    • node.obj_token
      : Real presentation token (used for subsequent operations)
    • node.title
      : Document title
  2. After confirming that
    obj_type
    is
    slides
    , use
    obj_token
    as
    xml_presentation_id

查询示例

Query Example

bash
undefined
bash
undefined

查询 wiki 节点

Query wiki node

lark-cli wiki spaces get_node --as user --params '{"token":"wikcnxxxxxxxxx"}'

返回结果示例:
```json
{
   "node": {
      "obj_type": "slides",
      "obj_token": "xxxxxxxxxxxx",
      "title": "2026 产品年度总结",
      "node_type": "origin",
      "space_id": "1234567890"
   }
}
bash
undefined
lark-cli wiki spaces get_node --as user --params '{"token":"wikcnxxxxxxxxx"}'

Return result example:
```json
{
   "node": {
      "obj_type": "slides",
      "obj_token": "xxxxxxxxxxxx",
      "title": "2026 Product Annual Summary",
      "node_type": "origin",
      "space_id": "1234567890"
   }
}
bash
undefined

用 obj_token 读取幻灯片内容

Read slide content with obj_token

lark-cli slides xml_presentations get --as user --params '{"xml_presentation_id":"xxxxxxxxxxxx"}'
undefined
lark-cli slides xml_presentations get --as user --params '{"xml_presentation_id":"xxxxxxxxxxxx"}'
undefined

资源关系

Resource Relationship

text
Wiki Space (知识空间)
└── Wiki Node (知识库节点, obj_type: slides)
    └── obj_token → xml_presentation_id

Slides (演示文稿)
├── xml_presentation_id (演示文稿唯一标识)
├── revision_id (版本号)
└── Slide (幻灯片页面)
    └── slide_id (页面唯一标识)
text
Wiki Space
└── Wiki Node (obj_type: slides)
    └── obj_token → xml_presentation_id

Slides (Presentation)
├── xml_presentation_id (Unique identifier of presentation)
├── revision_id (Version number)
└── Slide (Presentation page)
    └── slide_id (Unique identifier of page)

Shortcuts(推荐优先使用)

Shortcuts (Recommended for Priority Use)

Shortcut 是对常用操作的高级封装(
lark-cli slides +<verb> [flags]
)。有 Shortcut 的操作优先使用。
Shortcut说明
+create
创建 PPT(可选
--slides
一步添加页面),bot 模式自动授权
Shortcut is a high-level encapsulation of common operations (
lark-cli slides +<verb> [flags]
). Prioritize operations with Shortcut if available.
ShortcutDescription
+create
Create PPT (optional
--slides
to add pages in one step), automatic authorization in bot mode

API Resources

API Resources

bash
lark-cli schema slides.<resource>.<method>    # 调用 API 前必须先查看参数结构
lark-cli slides <resource> <method> [flags]  # 调用 API
重要:使用原生 API 时,必须先运行
schema
查看
--data
/
--params
参数结构,不要猜测字段格式。
bash
lark-cli schema slides.<resource>.<method>    # Must check parameter structure before calling API
lark-cli slides <resource> <method> [flags]  # Call API
Important: When using native API, you must first run
schema
to view the
--data
/
--params
parameter structure, do not guess the field format.

xml_presentations

xml_presentations

  • get
    — 读取ppt全文信息,xml格式返回
  • get
    — Read full PPT information, return in xml format

xml_presentation.slide

xml_presentation.slide

  • create
    — 在指定 xml 演示文稿下创建页面
    • delete
      — 删除指定 xml 演示文稿下的页面
  • create
    — Create a page under the specified xml presentation
    • delete
      — Delete a page under the specified xml presentation

核心规则

Core Rules

  1. 先出大纲再动手:创建 PPT 前先生成大纲交给用户确认,避免返工
  2. 创建流程:10 页以内推荐
    slides +create --slides '[...]'
    一步创建;超过 10 页先
    slides +create
    创建空白 PPT,再用
    xml_presentation.slide.create
    逐页添加
  3. <slide>
    直接子元素只有
    <style>
    <data>
    <note>
    :文本和图形必须放在
    <data>
  4. 文本通过
    <content>
    表达
    :必须用
    <content><p>...</p></content>
    ,不能把文字直接写在 shape 内
  5. 保存关键 ID:后续操作需要
    xml_presentation_id
    slide_id
    revision_id
  6. 删除谨慎:删除操作不可逆,且至少保留一页幻灯片
  1. Outline first before operation: Generate an outline and submit it to the user for confirmation before creating PPT to avoid rework
  2. Creation process: For less than 10 pages, it is recommended to use
    slides +create --slides '[...]'
    to create in one step; for more than 10 pages, first use
    slides +create
    to create a blank PPT, then use
    xml_presentation.slide.create
    to add pages one by one
  3. Only
    <style>
    ,
    <data>
    ,
    <note>
    are direct child elements of
    <slide>
    : Text and graphics must be placed inside
    <data>
  4. Text is expressed through
    <content>
    : Must use
    <content><p>...</p></content>
    , cannot write text directly in shape
  5. Save key IDs: Subsequent operations require
    xml_presentation_id
    ,
    slide_id
    ,
    revision_id
  6. Be careful with deletion: Deletion operation is irreversible, and at least one slide must be retained

权限表

Permission Table

方法所需 scope
slides +create
slides:presentation:create
,
slides:presentation:write_only
xml_presentations.get
slides:presentation:read
xml_presentation.slide.create
slides:presentation:update
slides:presentation:write_only
xml_presentation.slide.delete
slides:presentation:update
slides:presentation:write_only
MethodRequired scope
slides +create
slides:presentation:create
,
slides:presentation:write_only
xml_presentations.get
slides:presentation:read
xml_presentation.slide.create
slides:presentation:update
or
slides:presentation:write_only
xml_presentation.slide.delete
slides:presentation:update
or
slides:presentation:write_only

常见错误速查

Common Error Quick Check

错误码含义解决方案
400XML 格式错误检查 XML 语法,确保标签闭合
400create 内容超出支持范围
xml_presentations.create
仅用于创建空白 PPT,不要在这里传完整 slide 内容
400请求包装错误检查
--data
是否按 schema 传入
xml_presentation.content
slide.content
404演示文稿不存在检查
xml_presentation_id
是否正确
404幻灯片不存在检查
slide_id
是否正确
403权限不足检查是否拥有对应的 scope
400无法删除唯一幻灯片演示文稿至少保留一页幻灯片
Error CodeMeaningSolution
400XML format errorCheck XML syntax to ensure tags are closed
400create content exceeds supported range
xml_presentations.create
is only used to create blank PPT, do not pass complete slide content here
400Request packaging errorCheck whether
--data
is passed into
xml_presentation.content
or
slide.content
according to the schema
404Presentation does not existCheck whether
xml_presentation_id
is correct
404Slide does not existCheck whether
slide_id
is correct
403Insufficient permissionCheck whether you have the corresponding scope
400Cannot delete the only slideAt least one slide must be retained in the presentation

创建前自查

Self-check Before Creation

逐页生成 XML 前,快速检查:
  • 每页背景色/渐变是否设置?风格是否与整体一致?
  • 标题用大字号(28-48),正文用小字号(13-16),层级分明?
  • 同类元素配色一致?(如所有指标卡片同色系、所有正文同色)
  • 装饰元素(分割线、色块、竖线)颜色是否与主色协调?
  • 文本框尺寸是否足够容纳内容?(宽度 × 高度)
  • shape 的
    type
    是否正确?(文本框用
    text
    ,装饰用
    rect
  • XML 标签是否全部正确闭合?特殊字符(
    &
    <
    >
    )是否转义?
Before generating XML page by page, check quickly:
  • Is the background color/gradient set for each page? Is the style consistent with the whole?
  • Title uses large font size (28-48), body uses small font size (13-16), with clear hierarchy?
  • Is the color matching of similar elements consistent? (e.g. all indicator cards are in the same color system, all body text is the same color)
  • Is the color of decorative elements (dividers, color blocks, vertical lines) coordinated with the primary color?
  • Is the text box size sufficient to accommodate the content? (width × height)
  • Is the
    type
    of shape correct? (use
    text
    for text boxes,
    rect
    for decoration)
  • Are all XML tags closed correctly? Are special characters (
    &
    ,
    <
    ,
    >
    ) escaped?

症状 → 修复表

Symptom → Fix Table

看到的问题改什么
文字被截断/看不全增大 shape 的
width
height
元素重叠调整
topLeftX
/
topLeftY
,拉开间距
页面大面积空白缩小元素间距,或增加内容填充
文字和背景色太接近深色背景用浅色文字,浅色背景用深色文字
表格列宽不合理调整
colgroup
col
width
图表没有显示检查
chartPlotArea
chartData
是否都包含,
dim1
/
dim2
数据数量是否匹配
渐变背景变成白色渐变必须用
rgba()
格式 + 百分比停靠点,如
linear-gradient(135deg,rgba(30,60,114,1) 0%,rgba(59,130,246,1) 100%)
;用
rgb()
或省略停靠点会被回退为白色
渐变方向不对调整
linear-gradient
的角度(
90deg
水平、
180deg
垂直、
135deg
对角线)
整体风格不统一封面页和结尾页用同一背景,内容页保持一致的配色和字号体系
API 返回 400检查 XML 语法:标签闭合、属性引号、特殊字符转义
API 返回 3350001
xml_presentation_id
不是通过
xml_presentations.create
创建的,或 token 不正确
Observed ProblemWhat to Fix
Text is truncated/not fully visibleIncrease the
width
or
height
of the shape
Elements overlapAdjust
topLeftX
/
topLeftY
to increase spacing
Large blank area on the pageReduce element spacing, or add content to fill
Text color is too close to background colorUse light text on dark background, dark text on light background
Unreasonable table column widthAdjust the
width
value of
col
in
colgroup
Chart is not displayedCheck whether both
chartPlotArea
and
chartData
are included, and whether the number of
dim1
/
dim2
data matches
Gradient background turns whiteGradient must use
rgba()
format + percentage stop points, such as
linear-gradient(135deg,rgba(30,60,114,1) 0%,rgba(59,130,246,1) 100%)
; using
rgb()
or omitting stop points will be reverted to white
Wrong gradient directionAdjust the angle of
linear-gradient
(
90deg
horizontal,
180deg
vertical,
135deg
diagonal)
Overall style is not unifiedUse the same background for cover page and closing page, maintain consistent color scheme and font size system for content pages
API returns 400Check XML syntax: tag closure, attribute quotes, special character escaping
API returns 3350001
xml_presentation_id
is not created via
xml_presentations.create
, or the token is incorrect

参考文档

Reference Documents

文档说明
lark-slides-create.md+create Shortcut:创建 PPT(支持
--slides
一步添加页面)
xml-schema-quick-ref.mdXML Schema 精简速查(必读)
slide-templates.md可复制的 Slide XML 模板
xml-format-guide.mdXML 详细结构与示例
examples.mdCLI 调用示例
slides_demo.xml真实 PPT 的完整 XML
slides_xml_schema_definition.xml完整 Schema 定义(唯一协议依据)
lark-slides-xml-presentations-create.md创建空白 PPT 命令详情
lark-slides-xml-presentations-get.md读取 PPT 命令详情
lark-slides-xml-presentation-slide-create.md添加幻灯片命令详情
lark-slides-xml-presentation-slide-delete.md删除幻灯片命令详情
注意:如果 md 内容与
slides_xml_schema_definition.xml
lark-cli schema slides.<resource>.<method>
输出不一致,以后两者为准。
DocumentDescription
lark-slides-create.md+create Shortcut: Create PPT (supports
--slides
to add pages in one step)
xml-schema-quick-ref.mdXML Schema simplified quick reference (mandatory reading)
slide-templates.mdCopyable Slide XML templates
xml-format-guide.mdDetailed XML structure and examples
examples.mdCLI call examples
slides_demo.xmlComplete XML of real PPT
slides_xml_schema_definition.xmlComplete Schema definition (only protocol basis)
lark-slides-xml-presentations-create.mdDetails of command to create blank PPT
lark-slides-xml-presentations-get.mdDetails of command to read PPT
lark-slides-xml-presentation-slide-create.mdDetails of command to add slides
lark-slides-xml-presentation-slide-delete.mdDetails of command to delete slides
Note: If the content of md files is inconsistent with the output of
slides_xml_schema_definition.xml
or
lark-cli schema slides.<resource>.<method>
, the latter two shall prevail.