重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/vm0-ai/vm0-skills --skill pdfco一站式 PDF 处理 API。转换、提取、合并、拆分、压缩 PDF 等。支持扫描文档的 OCR。
官方文档:https://docs.pdf.co/
在以下场景中使用此技能:
设置环境变量:
export PDFCO_API_KEY="your-email@example.com_your-api-key"
从 PDF 中提取文本(支持 OCR):
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
指定特定页面(从 1 开始计数):
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"pages": "1-3",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
将 PDF 表格转换为 CSV:
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-csv/sample.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/csv" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
将多个 PDF 合并为一个:
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample1.pdf,https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample2.pdf",
"name": "merged.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/merge" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
按页面范围拆分 PDF:
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/sample.pdf",
"pages": "1-2,3-"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/split" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
减小 PDF 文件大小:
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-optimize/sample.pdf",
"name": "compressed.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/optimize" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
将 HTML 或 URL 转换为 PDF:
写入 /tmp/request.json:
{
"html": "<h1>Hello World</h1><p>This is a test.</p>",
"name": "output.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/from/html" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
从 URL 转换:
写入 /tmp/request.json:
{
"url": "https://example.com",
"name": "webpage.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/from/url" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
从发票中提取结构化数据:
写入 /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/ai-invoice-parser/sample-invoice.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/ai-invoice-parser" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
首先上传本地文件,然后使用返回的 URL:
步骤 1:获取预签名上传 URL
curl -s "https://api.pdf.co/v1/file/upload/get-presigned-url?name=myfile.pdf&contenttype=application/pdf" --header "x-api-key: $(printenv PDFCO_API_KEY)" | jq -r '.presignedUrl, .url'
从响应中复制预签名 URL 和文件 URL。
步骤 2:上传文件
将 <presigned-url> 替换为步骤 1 中的 URL:
curl -X PUT "<presigned-url>" --header "Content-Type: application/pdf" --data-binary @/path/to/your/file.pdf
步骤 3:在后续 API 调用中使用文件 URL
将 <file-url> 替换为步骤 1 中的文件 URL:
写入 /tmp/request.json:
{
"url": "<file-url>",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
对于大文件,使用异步模式以避免超时:
步骤 1:启动异步任务
写入 /tmp/request.json:
{
"url": "https://example.com/large-file.pdf",
"async": true
}
curl -s --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json | jq -r '.jobId'
从响应中复制任务 ID。
步骤 2:检查任务状态
将 <job-id> 替换为步骤 1 中的任务 ID:
写入 /tmp/request.json:
{
"jobid": "<job-id>"
}
curl --location --request POST "https://api.pdf.co/v1/job/check" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
| 参数 | 类型 | 描述 |
|---|---|---|
url | string | 源文件的 URL(必需) |
inline | boolean | 在响应体中返回结果 |
async | boolean | 作为后台任务运行 |
pages | string | 页面范围,从 1 开始计数(例如:"1-3"、"1,3,5"、"2-") |
name | string | 输出文件名 |
password | string | 受保护 PDF 的密码 |
expiration | integer | 输出链接过期时间(分钟,默认:60) |
{
"url": "https://pdf-temp-files.s3.amazonaws.com/.../result.pdf",
"pageCount": 5,
"error": false,
"status": 200,
"name": "result.pdf",
"credits": 10,
"remainingCredits": 9990
}
当 inline: true 时,响应包含带有提取内容的 body 字段。
| 端点 | 描述 |
|---|---|
/pdf/convert/to/text | PDF 转文本(支持 OCR) |
/pdf/convert/to/csv | PDF 转 CSV |
/pdf/convert/to/json | PDF 转 JSON |
/pdf/merge | 合并多个 PDF |
/pdf/split | 按页面拆分 PDF |
/pdf/optimize | 压缩 PDF |
/pdf/convert/from/html | HTML 转 PDF |
/pdf/convert/from/url | URL 转 PDF |
/ai-invoice-parser | AI 驱动的发票解析 |
/document-parser | 基于模板的文档解析 |
/file/upload/get-presigned-url | 获取上传 URL |
/job/check | 检查异步任务状态 |
async: truelang 参数)remainingCredits每周安装量
64
代码仓库
GitHub 星标数
51
首次出现
2026年1月24日
安全审计
安装于
gemini-cli52
opencode52
codex50
cursor49
github-copilot49
amp48
All-in-one PDF processing API. Convert, extract, merge, split, compress PDFs and more. Supports OCR for scanned documents.
Official docs: https://docs.pdf.co/
Use this skill when you need to:
Set environment variable:
export PDFCO_API_KEY="your-email@example.com_your-api-key"
Extract text from PDF with OCR support:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
With specific pages (1-indexed):
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-text/sample.pdf",
"pages": "1-3",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Convert PDF tables to CSV:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-to-csv/sample.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/csv" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Combine multiple PDFs into one:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample1.pdf,https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-merge/sample2.pdf",
"name": "merged.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/merge" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Split PDF by page ranges:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-split/sample.pdf",
"pages": "1-2,3-"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/split" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Reduce PDF file size:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/pdf-optimize/sample.pdf",
"name": "compressed.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/optimize" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Convert HTML or URL to PDF:
Write to /tmp/request.json:
{
"html": "<h1>Hello World</h1><p>This is a test.</p>",
"name": "output.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/from/html" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
From URL:
Write to /tmp/request.json:
{
"url": "https://example.com",
"name": "webpage.pdf"
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/from/url" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Extract structured data from invoices:
Write to /tmp/request.json:
{
"url": "https://pdfco-test-files.s3.us-west-2.amazonaws.com/ai-invoice-parser/sample-invoice.pdf",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/ai-invoice-parser" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
Upload a local file first, then use the returned URL:
Step 1: Get presigned upload URL
curl -s "https://api.pdf.co/v1/file/upload/get-presigned-url?name=myfile.pdf&contenttype=application/pdf" --header "x-api-key: $(printenv PDFCO_API_KEY)" | jq -r '.presignedUrl, .url'
Copy the presigned URL and file URL from the response.
Step 2: Upload file
Replace <presigned-url> with the URL from Step 1:
curl -X PUT "<presigned-url>" --header "Content-Type: application/pdf" --data-binary @/path/to/your/file.pdf
Step 3: Use file URL in subsequent API calls
Replace <file-url> with the file URL from Step 1:
Write to /tmp/request.json:
{
"url": "<file-url>",
"inline": true
}
curl --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
For large files, use async mode to avoid timeouts:
Step 1: Start async job
Write to /tmp/request.json:
{
"url": "https://example.com/large-file.pdf",
"async": true
}
curl -s --location --request POST "https://api.pdf.co/v1/pdf/convert/to/text" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json | jq -r '.jobId'
Copy the job ID from the response.
Step 2: Check job status
Replace <job-id> with the job ID from Step 1:
Write to /tmp/request.json:
{
"jobid": "<job-id>"
}
curl --location --request POST "https://api.pdf.co/v1/job/check" --header "x-api-key: $(printenv PDFCO_API_KEY)" --header "Content-Type: application/json" -d @/tmp/request.json
| Parameter | Type | Description |
|---|---|---|
url | string | URL to source file (required) |
inline | boolean | Return result in response body |
async | boolean | Run as background job |
pages | string | Page range, 1-indexed (e.g., "1-3", "1,3,5", "2-") |
name | string |
{
"url": "https://pdf-temp-files.s3.amazonaws.com/.../result.pdf",
"pageCount": 5,
"error": false,
"status": 200,
"name": "result.pdf",
"credits": 10,
"remainingCredits": 9990
}
With inline: true, the response includes body field with extracted content.
| Endpoint | Description |
|---|---|
/pdf/convert/to/text | PDF to text (OCR supported) |
/pdf/convert/to/csv | PDF to CSV |
/pdf/convert/to/json | PDF to JSON |
/pdf/merge | Merge multiple PDFs |
/pdf/split | Split PDF by pages |
/pdf/optimize | Compress PDF |
async: true for files over 40 pages or 10MBlang for non-English)remainingCredits in responseWeekly Installs
64
Repository
GitHub Stars
51
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli52
opencode52
codex50
cursor49
github-copilot49
amp48
Lark Drive API 使用指南:飞书云文档、Wiki、表格 Token 处理与文件管理
40,700 周安装
| Output filename |
password | string | PDF password if protected |
expiration | integer | Output link expiration in minutes (default: 60) |
/pdf/convert/from/html | HTML to PDF |
/pdf/convert/from/url | URL to PDF |
/ai-invoice-parser | AI-powered invoice parsing |
/document-parser | Template-based document parsing |
/file/upload/get-presigned-url | Get upload URL |
/job/check | Check async job status |