---
url: https://docs.snapotter.com/zh-CN/tools/files/excel-to-pdf.md
description: 将电子表格转换为 PDF。
---

# Excel to PDF

将 Excel、OpenDocument 或 CSV 电子表格转换为 PDF。较宽的工作表可能会分页到多页。

## API Endpoint

`POST /api/v1/tools/files/excel-to-pdf`

接受包含 Excel/ODS/CSV 文件的 multipart 表单数据。

## Parameters

此工具没有可配置的参数。上传电子表格即可将其转换为 PDF。

## Example Request

```bash
curl -X POST http://localhost:1349/api/v1/tools/files/excel-to-pdf \
  -H "Authorization: Bearer si_your-api-key" \
  -F "file=@budget.xlsx"
```

## Example Response

返回 `202 Accepted`。通过 `/api/v1/jobs/{jobId}/progress` 处的 SSE 跟踪进度。

```json
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "async": true
}
```

## Notes

* 接受的输入格式：`.xlsx`、`.xls`、`.ods`、`.csv`。
* 较宽的工作表在生成的 PDF 中可能被拆分到多页。
* 图表和条件格式会在 PDF 输出中渲染。
* 转换由服务器上以无头模式运行的 LibreOffice 处理。
