pdf-tools-compdf

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PDF Toolkit

PDF Toolkit

Process PDF files through ComPDF Cloud REST API. Supports 50+ document processing operations.

When to Run

运行场景

  • User requests to convert file format (e.g., "convert this PDF to Word", "convert Excel to PDF")
  • User requests to edit PDF pages (e.g., "merge these two PDFs", "delete page 3", "rotate PDF")
  • User requests to add or remove watermarks from PDF
  • User requests to compress PDF files
  • User requests OCR recognition of scanned documents or text in images
  • User requests AI extraction or parsing of document content
  • User requests to extract tables from images
  • User requests batch processing of multiple document files
  • User requests to compare differences between two PDF documents
  • User mentions ComPDF, compdf, or related keywords
  • 用户请求转换文件格式(例如:“将这份PDF转换成Word”、“将Excel转换成PDF”)
  • 用户请求编辑PDF页面(例如:“合并这两份PDF”、“删除第3页”、“旋转PDF”)
  • 用户请求为PDF添加或移除水印
  • 用户请求压缩PDF文件
  • 用户请求对扫描文档或图片中的文本进行OCR识别
  • 用户请求对文档内容进行AI提取或解析
  • 用户请求从图片中提取表格
  • 用户请求批量处理多个文档文件
  • 用户请求对比两份PDF文档的差异
  • 用户提及ComPDF、compdf或相关关键词

Workflow

工作流程

Step 1 — Obtain API Key

步骤1 — 获取API密钥

Check whether
config/public_key.txt
exists and contains a non-empty value.
The key file is not included in the published skill package. It is created at runtime only when the user explicitly opts in. The user may delete
config/public_key.txt
at any time to revoke local storage.
检查
config/public_key.txt
是否存在且包含非空值。
密钥文件不包含在已发布的技能包中,仅当用户明确选择启用时才会在运行时创建。用户可随时删除
config/public_key.txt
以撤销本地存储。

Step 2 — Confirm External Upload Intent

步骤2 — 确认外部上传意向

Before uploading any file, explicitly inform the user:
⚠️ External Upload Confirmation Required
Your file will be uploaded to ComPDF's servers (api-server.compdf.com or api-server.compdf.cn) for processing. Please confirm that:
  1. You consent to uploading this file to external servers.
  2. The file does not contain highly sensitive or confidential data, or you accept the associated risk.
  3. You have reviewed ComPDF's Privacy Policy at https://www.compdf.com/privacy-policy/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_pdf_toolkit&ref_platform_id=clawhub_skills.
Only proceed with the upload after receiving explicit user confirmation.
在上传任何文件之前,明确告知用户:
⚠️ 需确认外部上传
您的文件将被上传至ComPDF的服务器(api-server.compdf.com或api-server.compdf.cn)进行处理。请确认:
  1. 您同意将此文件上传至外部服务器。
  2. 该文件不包含高度敏感或机密数据,或您愿意承担相关风险。
  3. 您已查看ComPDF的隐私政策:https://www.compdf.com/privacy-policy/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_pdf_toolkit&ref_platform_id=clawhub_skills
仅在收到用户明确确认后,方可继续上传。

Step 3 — Determine Base URL

步骤3 — 确定基础URL

Ask or infer the user's network environment:
EnvironmentBase URL
International
https://api-server.compdf.com/server/v2
Mainland China
https://api-server.compdf.cn/server/v2
询问或推断用户的网络环境:
环境基础URL
国际版
https://api-server.compdf.com/server/v2
中国大陆版
https://api-server.compdf.cn/server/v2

Step 4 — Select Tool

步骤4 — 选择工具

Look up the
executeTypeUrl
for the user's task in
references/tool-list.md
.
Quick reference for common operations:
OperationexecuteTypeUrl
PDF → Word
pdf/docx
PDF → Excel
pdf/xlsx
PDF → Image
pdf/img
PDF → Markdown
pdf/markdown
Word → PDF
docx/pdf
Merge PDF
pdf/merge
Split PDF
pdf/split
Add Watermark
pdf/addWatermark
PDF Compression
pdf/compress
OCR
documentAI/ocr
AI Document Extraction
idp/documentExtract
AI Document Parsing
idp/documentParsing
For the full list of 50+ tools, see
references/tool-list.md
.
references/tool-list.md
中查找用户任务对应的
executeTypeUrl
常见操作快速参考:
操作executeTypeUrl
PDF → Word
pdf/docx
PDF → Excel
pdf/xlsx
PDF → 图片
pdf/img
PDF → Markdown
pdf/markdown
Word → PDF
docx/pdf
合并PDF
pdf/merge
拆分PDF
pdf/split
添加水印
pdf/addWatermark
PDF压缩
pdf/compress
OCR识别
documentAI/ocr
AI文档提取
idp/documentExtract
AI文档解析
idp/documentParsing
如需查看50余种工具的完整列表,请参阅
references/tool-list.md

Step 5 — Build Parameters (optional)

步骤5 — 构建参数(可选)

If the selected tool supports custom parameters, look up its JSON schema in
references/parameters.md
. Parameters are passed as a JSON string in the
parameter
form-data field. If omitted, server defaults apply.
若所选工具支持自定义参数,请在
references/parameters.md
中查找其JSON schema。参数需以JSON字符串的形式在
parameter
表单数据字段中传递。若省略,将使用服务器默认值。

Step 6 — Send Request

步骤6 — 发送请求

After the user has explicitly confirmed the external upload:
  1. Send a
    POST
    request to
    {baseUrl}/process/{executeTypeUrl}
    .
  2. Include the user-provided API key in the
    x-api-key
    header for the current session only.
  3. Send the selected file as multipart form-data.
  4. Include the
    parameter
    field only when the selected tool supports custom parameters.
  5. Use the synchronous
    /process/
    endpoint so the complete result is returned in a single response.
Do not send the request until the user has confirmed that the file may be transmitted to ComPDF Cloud.
在用户明确确认外部上传后:
  1. {baseUrl}/process/{executeTypeUrl}
    发送
    POST
    请求。
  2. x-api-key
    请求头中包含用户提供的API密钥,仅当前会话有效。
  3. 以多部分表单数据形式发送所选文件。
  4. 仅当所选工具支持自定义参数时,才包含
    parameter
    字段。
  5. 使用同步
    /process/
    端点,以便在单个响应中返回完整结果。
在用户确认可将文件传输至ComPDF Cloud之前,请勿发送请求。

Step 7 — Handle Response

步骤7 — 处理响应

1. Check
code
field
"200"
means success; anything else is an error.
2. Check
taskStatus
(should be
TaskFinish
for synchronous calls):
StatusMeaningAction
TaskFinish
Processing completeProceed to download
TaskProcessing
Still processing internallyNotify user; suggest retrying shortly
TaskOverdue
Timed outRetry or split into smaller tasks
3. Extract download link from
fileInfoDTOList[].downloadUrl
.
4. Warn the user: download links expire at 24:00 the next day.
5. On failure: read
failureCode
and
failureReason
, then look up troubleshooting advice in
references/error-codes.md
.
6. On quota exhaustion (
code
=
"06001"
): inform the user:
1. 检查
code
字段
"200"
表示成功;其他值均为错误。
2. 检查
taskStatus
(同步调用时应为
TaskFinish
):
状态含义操作
TaskFinish
处理完成继续下载
TaskProcessing
内部仍在处理通知用户,建议稍后重试
TaskOverdue
超时重试或拆分为更小的任务
3. 从
fileInfoDTOList[].downloadUrl
中提取下载链接。
4. 提醒用户:下载链接将于次日24:00过期
5. 处理失败情况:读取
failureCode
failureReason
,然后在
references/error-codes.md
中查找故障排除建议。
6. 配额耗尽时
code
=
"06001"
):告知用户:

Auxiliary Endpoints

辅助端点

PurposeMethod & Path
List supported tools
GET {baseUrl}/tool/support
Check remaining credits
GET {baseUrl}/asset/info
List tasks
GET {baseUrl}/task/list?page=1&size=10
Close a task
POST {baseUrl}/task/closeTask?taskId={taskId}
用途方法与路径
列出支持的工具
GET {baseUrl}/tool/support
检查剩余额度
GET {baseUrl}/asset/info
列出任务
GET {baseUrl}/task/list?page=1&size=10
关闭任务
POST {baseUrl}/task/closeTask?taskId={taskId}

Output Format

输出格式

On success:
Processing complete!

File: {fileName} → {downFileName}
Status: {taskStatus}
Time taken: {convertTime}ms
Original size: {fileSize} bytes
Result size: {convertSize} bytes
Download link: {downloadUrl}

⚠️ The download link will expire at 24:00 tomorrow, please save it promptly.
On failure:
Processing failed.

Error code: {failureCode}
Reason: {failureReason}
Suggestion: {troubleshooting suggestion from references/error-codes.md}
成功时:
处理完成!

文件:{fileName} → {downFileName}
状态:{taskStatus}
耗时:{convertTime}ms
原大小:{fileSize} 字节
结果大小:{convertSize} 字节
下载链接:{downloadUrl}

⚠️ 下载链接将于次日24:00过期,请及时保存。
失败时:
处理失败。

错误代码:{failureCode}
原因:{failureReason}
建议:{来自references/error-codes.md的故障排除建议}

Critical Rules

重要规则

  1. HTTP 200 ≠ success — always check
    code
    and
    taskStatus
    in the JSON body.
  2. Max 5 files per task — split into multiple tasks if more files are needed.
  3. Free tier limit — 200 files within 30 days.
  4. File type auto-detection — the API detects uploaded file types; no need to rename extensions.
  5. Encrypted PDFs — provide the password in the
    password
    form-data field (separate from
    parameter
    ).
  6. China domain — mainland China users must replace
    compdf.com
    with
    compdf.cn
    .
  7. User-controlled API Key storage — the key file (
    config/public_key.txt
    ) is never shipped with the skill package. It is created at runtime only when the user explicitly opts in. The user may delete it at any time.
  8. External upload confirmation — always obtain explicit user consent before uploading files to ComPDF servers.
  1. HTTP 200 ≠ 成功 — 务必检查JSON响应体中的
    code
    taskStatus
  2. 每个任务最多5个文件 — 若需要处理更多文件,请拆分为多个任务。
  3. 免费层限制 — 30天内最多处理200个文件。
  4. 文件类型自动检测 — API会自动检测上传文件的类型,无需重命名文件扩展名。
  5. 加密PDF — 在
    password
    表单数据字段中提供密码(与
    parameter
    字段分开)。
  6. 中国域名 — 中国大陆用户必须将
    compdf.com
    替换为
    compdf.cn
  7. 用户可控的API密钥存储 — 密钥文件(
    config/public_key.txt
    )绝不会随技能包一同发布。仅当用户明确选择启用时才会在运行时创建,用户可随时删除该文件。
  8. 外部上传确认 — 在将文件上传至ComPDF服务器之前,务必获得用户的明确同意。

License & Copyright

许可与版权

Copyright © 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.
ComPDF and ComPDFKit are trademarks of PDF Technologies, Inc., a KDAN Company.
This skill package is licensed under the Apache License 2.0. See
LICENSE.txt
for the full license text.
The ComPDF Cloud API is a commercial service provided by PDF Technologies, Inc. Use of the API is subject to the ComPDF Terms of Service and Privacy Policy.
Copyright © 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.
ComPDF和ComPDFKit是PDF Technologies, Inc.(KDAN旗下公司)的商标。
本技能包采用Apache License 2.0许可。完整许可文本请参阅
LICENSE.txt
ComPDF Cloud API是PDF Technologies, Inc.提供的商业服务。使用该API需遵守ComPDF服务条款隐私政策。",