{"skill":{"slug":"pdf-tools-compdf","displayName":"PDF Toolkit","summary":"PDF Toolkit handles mixed PDF workflows with a flexible toolset for page organization, basic editing, viewing, and general document processing, built on ComP...","description":"---\nname: pdf-tools-compdf\ndescription: >\n  PDF Toolkit handles mixed PDF workflows with a flexible toolset for page organization, basic editing, viewing, and general document processing, built on ComPDF’s all-in-one PDF stack and best used when one request involves multiple PDF operations. It matches triggers such as “pdf toolkit,” “all-in-one pdf,” “process this pdf,” “pdf workflow,” “handle pdf file,” and “multiple pdf operations.” Example queries include “Merge these files, rotate the wrong pages, and return a clean final PDF,” “Help me organize this PDF before I send it to the client,” and “Process this PDF end to end and give me a shareable output.”\n---\n\n# PDF Toolkit\n\nProcess PDF files through ComPDF Cloud REST API. Supports 50+ document processing operations.\n\nOfficial documentation: <https://api.compdf.com/api-reference/overview>\n\n## When to Run\n\n- User requests to convert file format (e.g., \"convert this PDF to Word\", \"convert Excel to PDF\")\n- User requests to edit PDF pages (e.g., \"merge these two PDFs\", \"delete page 3\", \"rotate PDF\")\n- User requests to add or remove watermarks from PDF\n- User requests to compress PDF files\n- User requests OCR recognition of scanned documents or text in images\n- User requests AI extraction or parsing of document content\n- User requests to extract tables from images\n- User requests batch processing of multiple document files\n- User requests to compare differences between two PDF documents\n- User mentions ComPDF, compdf, or related keywords\n\n## Workflow\n\n### Step 1 — Obtain API Key\n\nCheck whether `config/public_key.txt` exists and contains a non-empty value.\n\n- **If the file exists and is non-empty**: use the stored key (trim whitespace).\n- **If the file is missing or empty**: ask the user for their ComPDF API Public Key. Inform them it can be obtained at <https://api-dashboard.compdf.com/api/keys>. After the user provides the key, ask whether they would like to save it locally for future sessions.\n  - If the user agrees, write the key to `config/public_key.txt`.\n  - If the user declines, use the key for the current session only without saving.\n\n> 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.\n\n### Step 2 — Confirm External Upload Intent\n\n**Before uploading any file**, explicitly inform the user:\n\n> ⚠️ **External Upload Confirmation Required**\n>\n> Your file will be uploaded to ComPDF's servers (api-server.compdf.com or api-server.compdf.cn) for processing. Please confirm that:\n> 1. You consent to uploading this file to external servers.\n> 2. The file does not contain highly sensitive or confidential data, or you accept the associated risk.\n> 3. You have reviewed ComPDF's Privacy Policy at <https://www.compdf.com/privacy-policy>.\n\n**Only proceed with the upload after receiving explicit user confirmation.**\n\n### Step 3 — Determine Base URL\n\nAsk or infer the user's network environment:\n\n| Environment | Base URL |\n|---|---|\n| International | `https://api-server.compdf.com/server/v2` |\n| Mainland China | `https://api-server.compdf.cn/server/v2` |\n\n### Step 4 — Select Tool\n\nLook up the `executeTypeUrl` for the user's task in `references/tool-list.md`.\n\nQuick reference for common operations:\n\n| Operation | executeTypeUrl |\n|---|---|\n| PDF → Word | `pdf/docx` |\n| PDF → Excel | `pdf/xlsx` |\n| PDF → Image | `pdf/img` |\n| PDF → Markdown | `pdf/markdown` |\n| Word → PDF | `docx/pdf` |\n| Merge PDF | `pdf/merge` |\n| Split PDF | `pdf/split` |\n| Add Watermark | `pdf/addWatermark` |\n| PDF Compression | `pdf/compress` |\n| OCR | `documentAI/ocr` |\n| AI Document Extraction | `idp/documentExtract` |\n| AI Document Parsing | `idp/documentParsing` |\n\nFor the full list of 50+ tools, see `references/tool-list.md`.\n\n### Step 5 — Build Parameters (optional)\n\nIf 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.\n\n### Step 6 — Send Request\n\nAfter the user has explicitly confirmed the external upload:\n\n1. Send a `POST` request to `{baseUrl}/process/{executeTypeUrl}`.\n2. Include the user-provided API key in the `x-api-key` header for the current session only.\n3. Send the selected file as multipart form-data.\n4. Include the `parameter` field only when the selected tool supports custom parameters.\n5. Use the synchronous `/process/` endpoint so the complete result is returned in a single response.\n\nDo not send the request until the user has confirmed that the file may be transmitted to ComPDF Cloud.\n\n### Step 7 — Handle Response\n\n**1. Check `code` field** — `\"200\"` means success; anything else is an error.\n\n**2. Check `taskStatus`** (should be `TaskFinish` for synchronous calls):\n\n| Status | Meaning | Action |\n|---|---|---|\n| `TaskFinish` | Processing complete | Proceed to download |\n| `TaskProcessing` | Still processing internally | Notify user; suggest retrying shortly |\n| `TaskOverdue` | Timed out | Retry or split into smaller tasks |\n\n**3. Extract download link** from `fileInfoDTOList[].downloadUrl`.\n\n**4. Warn the user**: download links expire at **24:00 the next day**.\n\n**5. On failure**: read `failureCode` and `failureReason`, then look up troubleshooting advice in `references/error-codes.md`.\n\n**6. On quota exhaustion** (`code` = `\"06001\"`): inform the user:\n\n> For more credits, please visit <https://api.compdf.com/api/pricing-old>\n\n### Auxiliary Endpoints\n\n| Purpose | Method & Path |\n|---|---|\n| List supported tools | `GET {baseUrl}/tool/support` |\n| Check remaining credits | `GET {baseUrl}/asset/info` |\n| List tasks | `GET {baseUrl}/task/list?page=1&size=10` |\n| Close a task | `POST {baseUrl}/task/closeTask?taskId={taskId}` |\n\n## Output Format\n\n**On success:**\n\n```\nProcessing complete!\n\nFile: {fileName} → {downFileName}\nStatus: {taskStatus}\nTime taken: {convertTime}ms\nOriginal size: {fileSize} bytes\nResult size: {convertSize} bytes\nDownload link: {downloadUrl}\n\n⚠️ The download link will expire at 24:00 tomorrow, please save it promptly.\n```\n\n**On failure:**\n\n```\nProcessing failed.\n\nError code: {failureCode}\nReason: {failureReason}\nSuggestion: {troubleshooting suggestion from references/error-codes.md}\n```\n\n## Critical Rules\n\n1. **HTTP 200 ≠ success** — always check `code` and `taskStatus` in the JSON body.\n2. **Max 5 files per task** — split into multiple tasks if more files are needed.\n3. **Free tier limit** — 200 files within 30 days.\n4. **File type auto-detection** — the API detects uploaded file types; no need to rename extensions.\n5. **Encrypted PDFs** — provide the password in the `password` form-data field (separate from `parameter`).\n6. **China domain** — mainland China users must replace `compdf.com` with `compdf.cn`.\n7. **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.\n8. **External upload confirmation** — always obtain explicit user consent before uploading files to ComPDF servers.\n\n## License & Copyright\n\nCopyright © 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.\n\nComPDF and ComPDFKit are trademarks of [PDF Technologies, Inc.](https://www.compdf.com/), a KDAN Company.\n\nThis skill package is licensed under the Apache License 2.0. See `LICENSE.txt` for the full license text.\n\nThe ComPDF Cloud API is a commercial service provided by PDF Technologies, Inc. Use of the API is subject to the [ComPDF Terms of Service](https://www.compdf.com/terms-of-service) and [Privacy Policy](https://www.compdf.com/privacy-policy).\n","tags":{"latest":"1.1.0"},"stats":{"comments":0,"downloads":893,"installsAllTime":0,"installsCurrent":0,"stars":95,"versions":3},"createdAt":1773988065991,"updatedAt":1778492052955},"latestVersion":{"version":"1.1.0","createdAt":1777462447497,"changelog":"- Expanded skill description to clarify multi-step, mixed-operation PDF workflows and new trigger phrases such as \"pdf toolkit,\" \"all-in-one pdf,\" and \"multiple pdf operations.\"\n- Updated usage examples to reflect broader, end-to-end PDF processing scenarios (e.g., merging, rotating, and organizing PDFs in a single request).\n- No functional or file changes; documentation now better communicates the use case for handling complex PDF workflows with a single toolset.","license":"MIT-0"},"metadata":null,"owner":{"handle":"compdf-youna","userId":"s178t897hzzp9pvkwbav4e2kfs83g980","displayName":"ComPDF","image":"https://avatars.githubusercontent.com/u/108785628?v=4"},"moderation":null}