← 返回
未分类 中文

PDF Editor

PDF Editor edits and organizes PDF pages with merge, insert, reorder, exchange, and crop operations, built on ComPDF page management capabilities for fast PD...
PDF编辑器在ComPDF页面管理功能的支撑下,能够合并、插入、重排、交换和裁剪PDF页面,实现快速PDF处理。
compdf-youna
未分类 clawhub v1.1.0 2 版本 99723.8 Key: 无需
★ 106
Stars
📥 768
下载
💾 40
安装
2
版本
#latest

概述

PDF Editor — PDF Document Processing CLI Tool

Platform Detection (Agent must execute automatically)

Before running any CLI command, the Agent must automatically detect the platform (read env.platform: win32→Windows, darwin→Mac; or run uname -s). Do NOT ask the user about their platform.

Variable[Windows][Mac]
------------------------
{skill_root}/scripts/win/compdf_cli.exe{skill_root}/scripts/mac/compdf_cli
{skill_root}/scripts/win/license_key_windows.xml{skill_root}/scripts/mac/license_key_mac.xml
{"email":""}{"email":""}
{skill_root}/scripts/win/PDFA/sRGB2014.icc{skill_root}/scripts/mac/PDFA/sRGB2014.icc
{skill_root}/scripts/win/PDFA/CoatedFOGRA39.icc{skill_root}/scripts/mac/PDFA/CoatedFOGRA39.icc
Shell syntaxcmd + REMbash + #

> {skill_root} = the absolute path of the directory containing this SKILL.md.

CLI Download & Installation (Required on first use)

The CLI binary is not included in the Skill package. It is downloaded from the official ComPDFKit distribution server (download.compdf.com) operated by PDF Technologies, Inc. The Agent must complete the following steps before the first execution:

  1. Check whether exists → skip if it does
  2. Inform the user that the CLI binary will be downloaded from download.compdf.com (official ComPDFKit CDN)
  3. Download the appropriate archive for the platform:
    • [Windows]: https://download.compdf.com/skills/winCLI/win.zip
    • [Mac]: https://download.compdf.com/skills/macCLI/mac.zip
  4. Extract the archive to the {skill_root}/scripts/ directory (the zip already contains a win/ or mac/ prefix, so the correct directory structure is formed automatically after extraction)
  5. [Mac] After extraction, run: chmod +x {skill_root}/scripts/mac/compdf_cli
  6. Verify: run --help to confirm the binary is executable

> Download is performed once on first use only; no re-download is needed on subsequent runs.

License Activation (Required on first use)

  1. Check whether exists → skip if it does
  2. Ask the user for their email address (explain: the email is sent to the official ComPDFKit license server to obtain a free trial license; no other data is transmitted)
  3. After the user confirms, send POST https://wms.compdf.com/api/license/skillsTrial, Body:
    • code=200: write the data.license XML to
    • code=500: prompt the user to retry with a different email address
  4. Run --help to verify activation

Common Options

The following options apply to all commands (they are not repeated in individual command references):

OptionDescriptionDefault
--------------------
--output, -o Output file path or directoryDirectory of the input file
--name Output filename{original_filename}_{command_name}.pdf
--overwriteAllow overwriting existing filesNo

Command Reference

split — Split PDF

split [options]

OptionDescriptionDefault
--------------------
`--mode range>`all=split into individual pages, range=split by rangeall
--range Page range, e.g. "1-3" (range mode only)

Output naming: all{original_filename}_page_{page_number}.pdf; range{original_filename}_pages_{start}-{end}.pdf

merge — Merge PDFs

merge [file3.pdf ...] [options]

> Encrypted PDFs are skipped automatically; if fewer than 2 unencrypted files remain, the command fails.

extract — Extract Pages

extract --range [options]

OptionDescription
------------
--range Required, e.g. "2-5" or "3"

rotate — Rotate Pages

rotate --pages --angle <90|180|270> [options]

OptionDescription
------------
--pages Required, page range
`--angle <90\180\270>`Required, rotation angle

delete — Delete Pages

delete --pages [options]

OptionDescription
------------
--pages Required, page range to delete

insert — Insert Pages/Images

<CLI> insert <target.pdf> --source <source.pdf> --pages <range> --at <position> [options]
<CLI> insert <target.pdf> --image <imagePath> --at <position> --width <width> --height <height> [options]
OptionDescription
------------
--source Source PDF (mutually exclusive with --image)
--image Image path (mutually exclusive with --source)
--pages Page range from the source PDF; --source mode only
--at Required, insert before page N (1-based)
--width / --height Image page dimensions; --image mode only (A4: 595×842)

convert — Standard Format Conversion

convert --standard [options]

OptionDescriptionDefault
--------------------
--standardRequired: pdfa-1a pdfa-1b pdfa-2a pdfa-2b pdfa-2u pdfx-4 pdfe-1 pdfua-1
--icc ICC profile file or
--title </code></td><td>PDF/UA title (<code>pdfua-1</code> only)</td><td>Input filename</td></tr><tr><td><code>--language <language></code></td><td>PDF/UA language (<code>pdfua-1</code> only)</td><td>Win: <code>en-US</code> / Mac: <code>en</code></td></tr></tbody></table><p><code>--language</code> supported values: Win <code>en-US</code>/<code>zh-CN</code>/<code>ja-JP</code>/<code>ko-KR</code>/<code>fr-FR</code>/<code>de-DE</code> | Mac <code>en</code>/<code>zh</code>/<code>ja</code>/<code>ko</code></p><p><strong>Examples</strong>:</p><pre><code><CLI> convert "report.pdf" --standard pdfa-1a --overwrite <CLI> convert "report.pdf" --standard pdfua-1 --title "My Document" --language zh-CN --overwrite </code></pre><h3>optimize — Document Optimization & Compression</h3><p><code><CLI> optimize <input.pdf> [options]</code></p><table><thead><tr><th>Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>------</td><td>------</td><td>--------</td></tr><tr><td><code>--compress-images</code></td><td>Enable image compression</td><td>No</td></tr><tr><td><code>--image-quality <0-100></code></td><td>Image quality</td><td><code>50</code></td></tr><tr><td><code>--target-ppi <integer></code></td><td>Target image PPI</td><td><code>150</code></td></tr><tr><td><code>--upper-ppi <integer></code></td><td>Compression upper-limit PPI</td><td>Win <code>300</code> / Mac <code>225</code></td></tr><tr><td><code>--image-alg <algorithm></code></td><td><code>jpeg</code>/<code>jpeg2000</code>/<code>jbig2</code>/<code>ccitt3</code>/<code>ccitt4</code></td><td><code>jpeg2000</code></td></tr><tr><td><code>--fast-web-view</code></td><td>Fast Web View optimization</td><td>No</td></tr><tr><td><code>--optimize-page-content</code></td><td>Page content optimization</td><td>No</td></tr><tr><td><code>--remove-annotations</code></td><td>Remove annotations</td><td>No</td></tr><tr><td><code>--remove-bookmarks</code></td><td>Remove bookmarks</td><td>No</td></tr><tr><td><code>--remove-form</code></td><td>Remove forms</td><td>No</td></tr><tr><td><code>--remove-metadata</code></td><td>Remove metadata</td><td>No</td></tr><tr><td><code>--remove-doc-info</code></td><td>Remove document info</td><td>No</td></tr><tr><td><code>--incremental</code></td><td>Incremental save mode</td><td>No</td></tr></tbody></table><p>Default behavior: removes unused/empty objects and enables Flate compression. Image compression is only enabled when <code>--compress-images</code> or image-related parameters are explicitly passed.</p><p><strong>Examples</strong>:</p><pre><code><CLI> optimize "report.pdf" --overwrite <CLI> optimize "report.pdf" --compress-images --image-quality 55 --target-ppi 144 --overwrite </code></pre><h3>compare — Overlay Document Comparison</h3><p><code><CLI> compare <old.pdf> <new.pdf> [options]</code></p><table><thead><tr><th>Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>------</td><td>------</td><td>--------</td></tr><tr><td><code>--old-pages</code> / <code>--new-pages</code></td><td>Page range</td><td>All pages</td></tr><tr><td><code>--old-color</code> / <code>--new-color</code></td><td>Stroke color <code>R,G,B</code></td><td><code>255,0,0</code> / <code>0,0,255</code></td></tr><tr><td><code>--old-stroke-alpha</code> / <code>--new-stroke-alpha</code></td><td>Stroke opacity 0-1</td><td><code>0.8</code></td></tr><tr><td><code>--old-fill-alpha</code> / <code>--new-fill-alpha</code></td><td>Fill opacity 0-1</td><td><code>0.2</code></td></tr><tr><td><code>--no-fill</code></td><td>Hide fill</td><td>No</td></tr><tr><td><code>--blend-mode</code></td><td><code>normal</code>/<code>multiply</code>/<code>screen</code>/<code>overlay</code>/<code>darken</code>/<code>lighten</code>/<code>difference</code></td><td><code>overlay</code></td></tr></tbody></table><h3>watermark-text — Add Text Watermark</h3><p><code><CLI> watermark-text <input.pdf> --text <content> [options]</code></p><h3>watermark-image — Add Image Watermark</h3><p><code><CLI> watermark-image <input.pdf> --image <image_path> [options]</code></p><h3>Shared Watermark Options</h3><table><thead><tr><th>Option</th><th>Description</th><th>[Win] Default</th><th>[Mac] Default</th></tr></thead><tbody><tr><td>------</td><td>------</td><td>-----------</td><td>-----------</td></tr><tr><td><code>--text <content></code></td><td>Watermark text (watermark-text only)</td><td>—</td><td>—</td></tr><tr><td><code>--image <path></code></td><td>Image path (watermark-image only)</td><td>—</td><td>—</td></tr><tr><td><code>--pages <range></code></td><td>Page range to apply</td><td>All</td><td>All</td></tr><tr><td><code>--font <font></code></td><td>Font (text only)</td><td><code>Helvetica</code></td><td><code>Helvetica</code></td></tr><tr><td><code>--font-size</code></td><td>Font size (text only)</td><td><code>24</code></td><td><code>48.0</code></td></tr><tr><td><code>--color <R,G,B></code></td><td>Text color (text only)</td><td><code>192,192,192</code></td><td><code>0,0,0</code></td></tr><tr><td><code>--opacity</code></td><td>Opacity</td><td><code>120</code> (0-255)</td><td><code>0.5</code> (0-1)</td></tr><tr><td><code>--rotation</code></td><td>Rotation angle</td><td><code>45</code></td><td><code>0.0</code></td></tr><tr><td><code>--scale</code></td><td>Scale factor</td><td><code>1.0</code></td><td><code>1.0</code></td></tr><tr><td><code>--h-align</code> / <code>--v-align</code></td><td>Alignment `left\</td><td>center\</td><td>right<code> / </code>top\</td><td>center\</td><td>bottom`</td><td><code>center</code></td><td><code>center</code></td></tr><tr><td><code>--x-offset</code> / <code>--y-offset</code></td><td>Offset</td><td><code>0</code></td><td><code>0</code></td></tr><tr><td><code>--h-spacing</code> / <code>--v-spacing</code></td><td>Spacing</td><td><code>80</code></td><td><code>0.0</code></td></tr><tr><td><code>--front</code> / <code>--back</code></td><td>Foreground/background</td><td>Foreground</td><td>Foreground</td></tr><tr><td><code>--full-screen</code> / <code>--single</code></td><td>Tiled/single</td><td>Tiled</td><td><strong>Must be passed explicitly</strong></td></tr></tbody></table><p>> <strong>⚠️ Mac</strong>: <code>--full-screen</code> is not enabled by default; tiled watermarks must be passed explicitly.</p><p><strong>Examples</strong> — [Windows]:</p><pre><code><CLI> watermark-text "report.pdf" --text "CONFIDENTIAL" --overwrite <CLI> watermark-image "report.pdf" --image "logo.png" --scale 0.5 --opacity 100 --overwrite </code></pre><p><strong>Examples</strong> — [Mac]:</p><pre><code><CLI> watermark-text "report.pdf" --text "CONFIDENTIAL" --full-screen --overwrite <CLI> watermark-image "report.pdf" --image "logo.png" --scale 0.5 --opacity 0.3 --full-screen --overwrite </code></pre><h3>watermark-delete — Remove All Watermarks</h3><p><code><CLI> watermark-delete <input.pdf> [options]</code></p><p>> [Win] <code>DeleteWatermarks()</code> removes all watermarks; [Mac] iterates and removes one by one. Selective removal is not supported.</p><h2>Exit Codes</h2><table><thead><tr><th>Code</th><th>Meaning</th><th>Action</th></tr></thead><tbody><tr><td>----</td><td>------</td><td>------</td></tr><tr><td><code>0</code></td><td>Success</td><td>—</td></tr><tr><td><code>1</code></td><td>Parameter error</td><td>Check required parameters</td></tr><tr><td><code>2</code></td><td>File not found</td><td>Check path; wrap paths with spaces in double quotes</td></tr><tr><td><code>3</code></td><td>Runtime error</td><td>PDF processing failed or output directory is not writable</td></tr><tr><td><code>4</code></td><td>License failure</td><td>Missing → run activation; Expired → direct user to <a href="https://www.compdf.com/contact-sales" target="_blank" rel="noopener">contact sales</a></td></tr></tbody></table><h2>Usage Patterns (Agent quick reference)</h2><table><thead><tr><th>User says</th><th>Command</th></tr></thead><tbody><tr><td>--------</td><td>------</td></tr><tr><td>"Split into single pages"</td><td><code><CLI> split "input.pdf" --mode all --overwrite</code></td></tr><tr><td>"Merge PDFs"</td><td><code><CLI> merge "a.pdf" "b.pdf" --output "merged.pdf" --overwrite</code></td></tr><tr><td>"Extract pages X to Y"</td><td><code><CLI> extract "input.pdf" --range X-Y --output "out.pdf" --overwrite</code></td></tr><tr><td>"Convert to PDF/A"</td><td><code><CLI> convert "input.pdf" --standard pdfa-1a --overwrite</code></td></tr><tr><td>"Compress PDF"</td><td><code><CLI> optimize "input.pdf" --compress-images --image-quality 50 --overwrite</code></td></tr><tr><td>"Compare two PDFs"</td><td><code><CLI> compare "old.pdf" "new.pdf" --overwrite</code></td></tr><tr><td>"Add text watermark"</td><td><code><CLI> watermark-text "input.pdf" --text "CONFIDENTIAL" --overwrite</code></td></tr><tr><td>"Add image watermark"</td><td><code><CLI> watermark-image "input.pdf" --image "logo.png" --overwrite</code></td></tr><tr><td>"Remove watermark"</td><td><code><CLI> watermark-delete "input.pdf" --overwrite</code></td></tr><tr><td>"Rotate pages"</td><td><code><CLI> rotate "input.pdf" --pages X-Y --angle 90 --overwrite</code></td></tr><tr><td>"Delete page X"</td><td><code><CLI> delete "input.pdf" --pages X --overwrite</code></td></tr><tr><td>"Insert pages"</td><td><code><CLI> insert "target.pdf" --source "src.pdf" --pages X --at N --overwrite</code></td></tr><tr><td>"Insert image"</td><td><code><CLI> insert "target.pdf" --image "img.png" --at N --width 595 --height 842 --overwrite</code></td></tr></tbody></table><p>> ⚠️ Mac watermark commands require <code>--full-screen</code> to be passed explicitly (when tiling is desired).</p><h2>Limitations</h2><ol><li>Page ranges only support <code>"N"</code> or <code>"N-M"</code>; comma-separated values are not supported</li><li>Except for <code>merge</code> (which skips encrypted files automatically), encrypted PDFs will cause an error and exit</li><li>Wildcards, output path equal to input path, and multi-threaded parallel execution are not supported</li><li>Results of standard format conversion and optimization depend on the content of the input PDF</li><li><code>watermark-delete</code> removes all watermarks; selective removal is not supported</li><li><code>compare</code> performs visual overlay comparison and does not output a structured diff list</li></ol><h2>Troubleshooting</h2><table><thead><tr><th>Issue</th><th>Resolution</th></tr></thead><tbody><tr><td>------</td><td>------</td></tr><tr><td>Exit 4 / License error</td><td><code><LICENSE_PATH></code> missing → run activation; exists but still errors → License expired, direct user to https://www.compdf.com/contact-sales</td></tr><tr><td>File not found</td><td>Check path; wrap paths containing spaces in double quotes</td></tr><tr><td>Page number out of range</td><td>First confirm the total page count of the PDF</td></tr><tr><td>Standard format conversion failed</td><td>Check font embedding and whether the ICC file matches the target standard</td></tr><tr><td>Optimize/compare/watermark failed</td><td>Confirm the input PDF can be opened and is not encrypted; check parameter format and output path permissions</td></tr></tbody></table><hr><h2>Security & Privacy</h2><p><strong>All PDF processing is performed locally. No file content is uploaded.</strong></p><table><thead><tr><th>External Endpoint</th><th>Purpose</th><th>Data Sent</th><th>When</th><th>User Consent</th></tr></thead><tbody><tr><td>----------</td><td>------</td><td>----------</td><td>------</td><td>------</td></tr><tr><td><code>https://download.compdf.com/skills/...</code></td><td>Download CLI binary</td><td>None (HTTP GET)</td><td>First use only, if CLI not present</td><td>User is informed before download</td></tr><tr><td><code>POST https://wms.compdf.com/api/license/skillsTrial</code></td><td>SDK license activation</td><td>Email address only</td><td>First use only, if license not present</td><td>User provides email and confirms</td></tr></tbody></table><ul><li><strong>Official Source</strong>: Both endpoints are operated by <a href="https://www.compdf.com" target="_blank" rel="noopener">PDF Technologies, Inc.</a> (a KDAN Company), the publisher of ComPDFKit SDK.</li><li><strong>No Telemetry</strong>: The CLI does not collect usage statistics, crash reports, or any anonymous data.</li><li><strong>No Network Dependency</strong>: After initial setup, all commands run fully offline without accessing any external services.</li><li><strong>License File</strong>: The <code>license_key_windows.xml</code> / <code>license_key_mac.xml</code> generated after activation is stored only in the local <code>scripts/</code> directory.</li></ul><hr><h2>Copyright & License</h2><p>This Skill is built on the <strong>ComPDFKit SDK</strong>. © 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.</p><ul><li>License file: <code>License.txt</code> | Terms of Service: https://www.compdf.com/terms-of-service</li><li>Privacy Policy: https://www.compdf.com/privacy-policy | Commercial Licensing: https://www.compdf.com/contact-sales</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 2 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.1.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-05-02 03:25 安全 安全 </div> </li> <li> <div> <span class="version-tag">v1.0.1</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-03-31 08:38 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=a6c2ce08ee47389b7f8aec0503025110" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/26/420546_f8fc7160a457954f1c7cb2c837e077c4.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1781408176%3B1812944176&q-key-time=1781408176%3B1812944176&q-header-list=host&q-url-param-list=&q-signature=a6912160c137ee0daa624332a029c86417226d2c" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/pdf-to-word-docx">PDF to Word Converter</a></h3> <div class="rec-owner">compdf-youna</div> <div class="rec-desc">PDF转Word功能将PDF转换为可编辑的Word/DOCX文档,采用AI布局分析和表格识别,基于ComPDF Conversion SDK,更好地保留表格结构。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 98</span> <span style="color:#5b6abf;">📥 1,261</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/extract-pdf-compdf">PDF Extract</a></h3> <div class="rec-owner">compdf-youna</div> <div class="rec-desc">从PDF和图片中提取结构化数据,包括表格、OCR文字、图片和印章,基于ComPDF数据提取和AI文档技术。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 99</span> <span style="color:#5b6abf;">📥 853</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;"></span> <h3><a href="/s/pdf-tools-compdf">PDF Toolkit</a></h3> <div class="rec-owner">compdf-youna</div> <div class="rec-desc">PDF Toolkit handles mixed PDF workflows with a flexible toolset for page organization, basic editing, viewing, and gener</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 95</span> <span style="color:#5b6abf;">📥 853</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>