Documents

PDF Editor

Edit, merge, split, rotate, and convert PDFs from the command line with the ComPDFKit CLI engine.

What it does

PDF Editor wraps the ComPDFKit CLI binary to perform common page-level PDF operations: split, merge, extract, rotate, delete, insert (from another PDF or image), convert to PDF/A, PDF/X, PDF/E or PDF/UA standards, optimize for size, compare two documents as overlays, and apply text or image watermarks. On first use the agent downloads the CLI from download.compdf.com and activates a free trial license via email. The skill runs on Windows and Mac; encrypted files are skipped automatically during merge.

When to use it

  • Merging several PDFs into a single file
  • Splitting or extracting specific page ranges
  • Converting documents to PDF/A or PDF/UA for archival
  • Compressing large PDFs by lowering image quality and PPI

The skill document

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 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 <90180

delete — Delete Pages

delete --pages [options]

OptionDescription
--pages Required, page range to delete

insert — Insert Pages/Images

 insert  --source  --pages  --at  [options]
 insert  --image  --at  --width  --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 fileor
--title PDF/UA title (pdfua-1 only)Input filename
--language PDF/UA language (pdfua-1 only)Win:en-US / Mac: en

--language supported values: Win en-US/zh-CN/ja-JP/ko-KR/fr-FR/de-DE | Mac en/zh/ja/ko

Examples:

 convert "report.pdf" --standard pdfa-1a --overwrite
 convert "report.pdf" --standard pdfua-1 --title "My Document" --language zh-CN --overwrite

optimize — Document Optimization & Compression

optimize [options]

OptionDescriptionDefault
--compress-imagesEnable image compressionNo
--image-quality <0-100>Image quality50
--target-ppi Target image PPI150
--upper-ppi Compression upper-limit PPIWin300 / Mac 225
--image-alg jpeg/jpeg2000/jbig2/ccitt3/ccitt4jpeg2000
--fast-web-viewFast Web View optimizationNo
--optimize-page-contentPage content optimizationNo
--remove-annotationsRemove annotationsNo
--remove-bookmarksRemove bookmarksNo
--remove-formRemove formsNo
--remove-metadataRemove metadataNo
--remove-doc-infoRemove document infoNo
--incrementalIncremental save modeNo

Default behavior: removes unused/empty objects and enables Flate compression. Image compression is only enabled when --compress-images or image-related parameters are explicitly passed.

Examples:

 optimize "report.pdf" --overwrite
 optimize "report.pdf" --compress-images --image-quality 55 --target-ppi 144 --overwrite

compare — Overlay Document Comparison

compare [options]

OptionDescriptionDefault
--old-pages / --new-pagesPage rangeAll pages
--old-color / --new-colorStroke colorR,G,B255,0,0 / 0,0,255
--old-stroke-alpha / --new-stroke-alphaStroke opacity 0-10.8
--old-fill-alpha / --new-fill-alphaFill opacity 0-10.2
--no-fillHide fillNo
--blend-modenormal/multiply/screen/overlay/darken/lighten/differenceoverlay

watermark-text — Add Text Watermark

watermark-text --text [options]

watermark-image — Add Image Watermark

watermark-image --image [options]

Shared Watermark Options

OptionDescription[Win] Default[Mac] Default
--text Watermark text (watermark-text only)
--image Image path (watermark-image only)
--pages Page range to applyAllAll
--font Font (text only)HelveticaHelvetica
--font-sizeFont size (text only)2448.0
--color Text color (text only)192,192,1920,0,0
--opacityOpacity120 (0-255)0.5 (0-1)
--rotationRotation angle450.0
--scaleScale factor1.01.0
--h-align / --v-alignAlignment`leftcenterright/top
--x-offset / --y-offsetOffset00
--h-spacing / --v-spacingSpacing800.0
--front / --backForeground/backgroundForegroundForeground
--full-screen / --singleTiled/singleTiledMust be passed explicitly

⚠️ Mac: --full-screen is not enabled by default; tiled watermarks must be passed explicitly.

Examples — [Windows]:

 watermark-text "report.pdf" --text "CONFIDENTIAL" --overwrite
 watermark-image "report.pdf" --image "logo.png" --scale 0.5 --opacity 100 --overwrite

Examples — [Mac]:

 watermark-text "report.pdf" --text "CONFIDENTIAL" --full-screen --overwrite
 watermark-image "report.pdf" --image "logo.png" --scale 0.5 --opacity 0.3 --full-screen --overwrite

watermark-delete — Remove All Watermarks

watermark-delete [options]

[Win] DeleteWatermarks() removes all watermarks; [Mac] iterates and removes one by one. Selective removal is not supported.

Exit Codes

CodeMeaningAction
0Success
1Parameter errorCheck required parameters
2File not foundCheck path; wrap paths with spaces in double quotes
3Runtime errorPDF processing failed or output directory is not writable
4License failureMissing → run activation; Expired → direct user tocontact sales

Usage Patterns (Agent quick reference)

User saysCommand
"Split into single pages" split "input.pdf" --mode all --overwrite
"Merge PDFs" merge "a.pdf" "b.pdf" --output "merged.pdf" --overwrite
"Extract pages X to Y" extract "input.pdf" --range X-Y --output "out.pdf" --overwrite
"Convert to PDF/A" convert "input.pdf" --standard pdfa-1a --overwrite
"Compress PDF" optimize "input.pdf" --compress-images --image-quality 50 --overwrite
"Compare two PDFs" compare "old.pdf" "new.pdf" --overwrite
"Add text watermark" watermark-text "input.pdf" --text "CONFIDENTIAL" --overwrite
"Add image watermark" watermark-image "input.pdf" --image "logo.png" --overwrite
"Remove watermark" watermark-delete "input.pdf" --overwrite
"Rotate pages" rotate "input.pdf" --pages X-Y --angle 90 --overwrite
"Delete page X" delete "input.pdf" --pages X --overwrite
"Insert pages" insert "target.pdf" --source "src.pdf" --pages X --at N --overwrite
"Insert image" insert "target.pdf" --image "img.png" --at N --width 595 --height 842 --overwrite

⚠️ Mac watermark commands require --full-screen to be passed explicitly (when tiling is desired).

Limitations

  1. Page ranges only support "N" or "N-M"; comma-separated values are not supported
  2. Except for merge (which skips encrypted files automatically), encrypted PDFs will cause an error and exit
  3. Wildcards, output path equal to input path, and multi-threaded parallel execution are not supported
  4. Results of standard format conversion and optimization depend on the content of the input PDF
  5. watermark-delete removes all watermarks; selective removal is not supported
  6. compare performs visual overlay comparison and does not output a structured diff list

Troubleshooting

IssueResolution
Exit 4 / License error`` missing → run activation; exists but still errors → License expired, direct user to https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_pdf_editor&ref_platform_id=clawhub_skills
File not foundCheck path; wrap paths containing spaces in double quotes
Page number out of rangeFirst confirm the total page count of the PDF
Standard format conversion failedCheck font embedding and whether the ICC file matches the target standard
Optimize/compare/watermark failedConfirm the input PDF can be opened and is not encrypted; check parameter format and output path permissions

Security & Privacy

All PDF processing is performed locally. No file content is uploaded.

External EndpointPurposeData SentWhenUser Consent
https://download.compdf.com/skills/...Download CLI binaryNone (HTTP GET)First use only, if CLI not presentUser is informed before download
POST https://wms.compdf.com/api/license/skillsTrialSDK license activationEmail address onlyFirst use only, if license not presentUser provides email and confirms
  • Official Source: Both endpoints are operated by PDF Technologies, Inc. (a KDAN Company), the publisher of ComPDFKit SDK.
  • No Telemetry: The CLI does not collect usage statistics, crash reports, or any anonymous data.
  • No Network Dependency: After initial setup, all commands run fully offline without accessing any external services.
  • License File: The license_key_windows.xml / license_key_mac.xml generated after activation is stored only in the local scripts/ directory.

This Skill is built on the ComPDFKit SDK. © 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.

Related skills

Process PDFs through the ComPDF Cloud REST API with 50+ operations: convert, merge, split, watermark, OCR, and more.

37 installs95 stars

Convert PDF or image files to 10 editable formats (Word, Excel, PPT, HTML, and more) via ComPDFKitConversion.

45 installs97 stars

Run 50+ PDF and document processing operations through the ComPDF Cloud API from one agent skill.

38 installs99 stars

Convert PDF and images to 10 structured formats locally via a Python CLI wrapper around the ComPDFKit SDK.

40 installs101 stars

Generate polished PDF and DOCX documents from prompts — resumes, contracts, reports, proposals, and more.

146 installs6 stars

Generate visually unified image-based PPT/PPTX decks from articles, reports, papers, notes, or outlines.

45 installs1 stars