PDF工具API
PDF文件的合并、拆分、压缩、转换、保护和操作端点。所有端点接受multipart/form-data并以二进制下载返回处理后的文件。
PDF合并
/api/pdf-merge将多个PDF文件合并为一个PDF文档。文件按上传顺序合并。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
files | File[] | Required | 要合并的多个PDF文件 |
合并后的PDF文件curl -X POST https://freefiletools.io/api/pdf-merge \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "[email protected]" \
-F "[email protected]" \
-o merged.pdfPDF拆分
/api/pdf-split根据页面范围将PDF文件拆分为多个部分。返回包含拆分后PDF的ZIP文件。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要拆分的PDF文件 |
ranges | string | Required | 页面范围,例如:"1-3,5,7-9"。每个范围生成一个单独的PDF。 |
包含拆分后PDF的ZIP文件curl -X POST https://freefiletools.io/api/pdf-split \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "ranges=1-3,5,7-9" \
-o split-pages.zipPDF压缩
/api/pdf-compress压缩PDF文件以减小其大小。使用Ghostscript进行高质量压缩。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要压缩的PDF文件 |
level | string | Optional | 压缩级别:"low"、"medium"或"high"。默认:"medium" |
压缩后的PDF文件curl -X POST https://freefiletools.io/api/pdf-compress \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "level=high" \
-o compressed.pdfPDF转Word
/api/pdf-to-word将PDF文件转换为Microsoft Word(.docx)文档。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的PDF文件 |
DOCX文件curl -X POST https://freefiletools.io/api/pdf-to-word \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o document.docxPDF转图像
/api/pdf-to-image将PDF页面转换为图像。返回包含每页一张图像的ZIP文件。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的PDF文件 |
format | string | Optional | 图像格式:"png"、"jpg"或"webp"。默认:"png" |
dpi | number | Optional | 分辨率(DPI)。默认:150 |
包含图像的ZIP文件curl -X POST https://freefiletools.io/api/pdf-to-image \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "format=png" \
-F "dpi=300" \
-o pages.zipPDF转Excel
/api/pdf-to-excel将PDF文件转换为Microsoft Excel(.xlsx)电子表格。对于包含表格数据的PDF效果最佳。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的PDF文件 |
XLSX文件curl -X POST https://freefiletools.io/api/pdf-to-excel \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o document.xlsxPDF转PowerPoint
/api/pdf-to-ppt将PDF文件转换为Microsoft PowerPoint(.pptx)演示文稿。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的PDF文件 |
PPTX文件curl -X POST https://freefiletools.io/api/pdf-to-ppt \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o presentation.pptxWord转PDF
/api/word-to-pdf将Microsoft Word(.docx)文档转换为PDF。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的.docx文件 |
PDF文件curl -X POST https://freefiletools.io/api/word-to-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o document.pdfPowerPoint转PDF
/api/ppt-to-pdf将Microsoft PowerPoint(.pptx)演示文稿转换为PDF。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的.pptx文件 |
PDF文件curl -X POST https://freefiletools.io/api/ppt-to-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o presentation.pdfExcel转PDF
/api/excel-to-pdf将Microsoft Excel(.xlsx)电子表格转换为PDF。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的.xlsx文件 |
PDF文件curl -X POST https://freefiletools.io/api/excel-to-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o spreadsheet.pdf保护PDF
/api/protect-pdf为PDF文件设置密码保护。生成的PDF需要密码才能打开。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要保护的PDF文件 |
password | string | Required | 要设置的PDF密码 |
受密码保护的PDF文件curl -X POST https://freefiletools.io/api/protect-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "password=mysecretpassword" \
-o protected.pdf解锁PDF
/api/unlock-pdf移除PDF文件的密码保护。需要当前密码。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 受密码保护的PDF文件 |
password | string | Required | PDF的当前密码 |
已解锁的PDF文件curl -X POST https://freefiletools.io/api/unlock-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "password=mysecretpassword" \
-o unlocked.pdf旋转PDF
/api/rotate-pdf将PDF文件的所有页面旋转指定角度。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要旋转的PDF文件 |
angle | number | Required | 旋转角度:90、180或270度 |
旋转后的PDF文件curl -X POST https://freefiletools.io/api/rotate-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "angle=90" \
-o rotated.pdfPDF水印
/api/watermark-pdf为PDF文件的所有页面添加文字水印。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要添加水印的PDF文件 |
text | string | Required | 要添加的水印文本 |
添加水印后的PDF文件curl -X POST https://freefiletools.io/api/watermark-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "text=CONFIDENTIAL" \
-o watermarked.pdfOCR PDF
/api/ocr-pdf对扫描的PDF应用光学字符识别(OCR),使文本可选择和可搜索。使用Tesseract OCR引擎。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 扫描的PDF文件 |
language | string | Optional | OCR语言:"eng"(英语)、"tur"(土耳其语)、"deu"(德语)等。默认:"eng" |
可搜索的PDF文件curl -X POST https://freefiletools.io/api/ocr-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "language=eng" \
-o searchable.pdf修复PDF
/api/repair-pdf尝试修复损坏的PDF文件。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 损坏的PDF文件 |
修复后的PDF文件curl -X POST https://freefiletools.io/api/repair-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o repaired.pdf裁剪PDF
/api/crop-pdf裁剪PDF文件的所有页面,移除空白或裁剪到特定区域。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要裁剪的PDF文件 |
裁剪后的PDF文件curl -X POST https://freefiletools.io/api/crop-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o cropped.pdf添加页码
/api/page-numbers为PDF文件的所有页面添加页码。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | PDF文件 |
带页码的PDF文件curl -X POST https://freefiletools.io/api/page-numbers \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o numbered.pdf图像转PDF
/api/img-to-pdf将一张或多张图像转换为PDF文件。每张图像成为一页。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
files | File[] | Required | 图像文件(JPG、PNG、WebP) |
PDF文件curl -X POST https://freefiletools.io/api/img-to-pdf \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-F "[email protected]" \
-F "[email protected]" \
-o images.pdfPDF转PDF/A
/api/pdf-to-pdfa将PDF文件转换为PDF/A格式以进行长期归档。使用Ghostscript进行转换。
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
file | File | Required | 要转换的PDF文件 |
PDF/A文件curl -X POST https://freefiletools.io/api/pdf-to-pdfa \
-H "x-api-key: fft_your_api_key" \
-F "[email protected]" \
-o document-pdfa.pdf