> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchhive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PDF Generation

> 配置一个在 Fetch Hive 中将 markdown 内容转换为 PDF 结果的工作流步骤

# PDF Generation

当你希望工作流步骤将 markdown 内容转换为后续步骤或运行可以引用的 PDF 结果时,请使用 **PDF Generation**。

## 配置

| 选项                                              | 是否必填 | 说明                                                               |
| ----------------------------------------------- | ---- | ---------------------------------------------------------------- |
| Name                                            | 否    | 步骤在工作流画布中的标签。                                                    |
| Content                                         | 是    | **Content** 中的内容。此字段支持 markdown 并通过 **Insert Variable** 支持工作流变量。 |
| When the step fails                             | 否    | 控制此步骤失败时工作流应 **Terminate Workflow** 还是 **Continue**。             |
| 从 **Search steps...** 的 **Generation** 分组添加此步骤。 |      |                                                                  |

**Content** 字段支持 markdown 格式。在生成 PDF 之前,使用 **Insert Variable** 组合来自 **Inputs** 或早前 **Workflow Steps** 的文本。

## 输出

点击步骤标题中的 **Run** 来测试步骤。运行完成后,Fetch Hive 会在 **Output** 中显示生成的结果。

在后续步骤中使用变量选择器插入该次运行可用的确切输出路径。基础引用为:

```text theme={null}
{{STEP_IDENTIFIER.output}}
```

如果你需要生成的 PDF 结果中更深层的字段或文件引用,请使用变量选择器。

## 示例

从 **Search steps...** 的 **Generation** 分组中添加 **PDF Generation**。

将 **Name** 设置为类似 `Create weekly report PDF` 的内容。

在 **Content** 中使用 markdown 标题、列表和插入的工作流值(例如 `{{step_2.output.summary}}`)编写文档。

选择 **When the step fails** 时应执行的行为。

点击 **Run** 并查看 **Output** 以确认生成的结果,然后再在工作流的其他位置使用。

{/* Add screenshot: PDF Generation settings sheet with markdown content */}

## 备注

* 本页位于文档树中的 `utility` 之下,但实际步骤显示在 Fetch Hive 步骤选择器的 **Generation** 之下。
* **Content** 字段支持 markdown,因此你可以在生成 PDF 之前格式化标题、列表和章节。
* 如果 PDF 应包含早前工作流步骤生成的文本,请使用 **Insert Variable**。

另见:[创建和编辑](../../creating-and-editing)、[测试与迭代](../../testing-and-iteration) 和 [错误处理](../../error-handling)
