pdf-to-word-docx
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePDF to Word Converter
PDF转Word转换器
Purpose
用途
- Wraps the Python SDK into a reusable local conversion workflow, supporting PDF / image to Word, PPT, Excel, HTML, RTF, Image, TXT, JSON, Markdown, and CSV (10 output formats in total).
ComPDFKitConversion
- 将Python SDK封装为可复用的本地转换工作流,支持PDF/图片转换为Word、PPT、Excel、HTML、RTF、图片、TXT、JSON、Markdown和CSV(共10种输出格式)。
ComPDFKitConversion
Agent Skills Standard Compatibility
Agent Skills标准兼容性
- This Skill uses an Anthropic Agent Skills-compatible directory structure: .
pdf-to-word-docx/ - The entry point is ; helper scripts are placed in
SKILL.md.scripts/ - The document uses and
$ARGUMENTSconventions for distribution and execution in Claude Code / Agent Skills-compatible environments.${CLAUDE_SKILL_DIR}
- 本Skill采用Anthropic Agent Skills兼容的目录结构:。
pdf-to-word-docx/ - 入口文件为;辅助脚本存放于
SKILL.md目录。scripts/ - 文档使用和
$ARGUMENTS约定,以便在Claude Code/Agent Skills兼容环境中分发和执行。${CLAUDE_SKILL_DIR}
Input / Output
输入/输出
- Input: The target format (/
word/excel/ppt/html/rtf/image/txt/json/markdown), the PDF or image path, and the output path are passed via Skill arguments or the command line. An optional PDF password and conversion parameters may also be provided.csv - Supported input file types:
- PDF files ()
.pdf - Image files (/
.jpg/.jpeg/.png/.bmp/.tif/.tiff/.webp/.jp2/.gif).tga
- PDF files (
- Output: A file in the corresponding format (,
.docx,.pptx,.xlsx,.html, image,.rtf,.txt,.json,.md), or a clear error message..csv
- 输入:目标格式(/
word/excel/ppt/html/rtf/image/txt/json/markdown)、PDF或图片路径、输出路径通过Skill参数或命令行传递。还可提供可选的PDF密码和转换参数。csv - 支持的输入文件类型:
- PDF文件()
.pdf - 图片文件(/
.jpg/.jpeg/.png/.bmp/.tif/.tiff/.webp/.jp2/.gif).tga
- PDF文件(
- 输出:对应格式的文件(、
.docx、.pptx、.xlsx、.html、图片、.rtf、.txt、.json、.md),或清晰的错误提示信息。.csv
Prerequisites
前置条件
- Supports Windows and macOS.
- The conversion SDK must be installed first:
bash
pip install ComPDFKitConversion - On first run, the script automatically downloads from the ComPDF server and caches it in the
license.xmldirectory:scripts/texthttps://download.compdf.com/skills/license/license.xml - The script reads the field from
<key>...</key>and uses that key forlicense.xmlauthentication — it does not pass the XML file path directly to the SDK.LibraryManager.license_verify(...) - To use a custom license, place your own in the
license.xmldirectory; the script will use it directly without downloading.scripts/ - During SDK initialization, the directory is always set to the directory containing
resource, i.e., thepdf-to-word-docx.pydirectory itself.scripts/ - When or
--enable-ocr(enabled by default) is used, the Skill also requires--enable-ai-layout. If the file does not exist, the script will automatically download it from:scripts/documentai.modeltexthttps://download.compdf.com/skills/model/documentai.model - To reuse an existing model file, you can override the default model path via an environment variable:
bash
export COMPDF_DOCUMENT_AI_MODEL="/path/to/documentai.model"
- 支持Windows和macOS系统。
- 必须先安装转换SDK:
bash
pip install ComPDFKitConversion - 首次运行时,脚本会自动从ComPDF服务器下载并缓存到
license.xml目录:scripts/texthttps://download.compdf.com/skills/license/license.xml - 脚本从中读取
license.xml字段,并使用该密钥进行<key>...</key>认证——不会直接将XML文件路径传递给SDK。LibraryManager.license_verify(...) - 若要使用自定义许可证,将您自己的放置在
license.xml目录中;脚本会直接使用该文件,不会自动下载。scripts/ - SDK初始化时,目录始终设置为包含
resource的目录,即pdf-to-word-docx.py目录本身。scripts/ - 当使用或
--enable-ocr(默认启用)时,Skill还需要--enable-ai-layout文件。若文件不存在,脚本会自动从以下地址下载:scripts/documentai.modeltexthttps://download.compdf.com/skills/model/documentai.model - 若要复用现有模型文件,可通过环境变量覆盖默认模型路径:
bash
export COMPDF_DOCUMENT_AI_MODEL="/path/to/documentai.model"
Workflow
工作流
- Confirm the Python package is installed:
bash
python -m pip show ComPDFKitConversion - The script automatically downloads on first run; the
license.xmldirectory is used directly as the SDKscripts/path.resource - In Agent Skills / Claude Code environments, prefer using the Skill's built-in script path variable:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" ppt input.pdf output.pptx python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx - For more control, append common parameters:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx --page-ranges "1-3,5" --excel-all-content --excel-worksheet-option for-page python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --enable-ocr --page-layout-mode flow - On startup, the script ensures exists (downloading it automatically from the ComPDF server if missing), reads the
scripts/license.xmlfield for SDK authentication, and uses the<key>directory as thescripts/path.resource - If or
--enable-ocr(enabled by default) is active, the script checks whether--enable-ai-layoutexists; if not, it downloads the file automatically before initializing the Document AI model.scripts/documentai.model - Check the return code; if it is not , handle license, password, resource, model, or input file issues according to the error name.
SUCCESS
- 确认Python包已安装:
bash
python -m pip show ComPDFKitConversion - 脚本首次运行时自动下载;
license.xml目录直接用作SDK的scripts/路径。resource - 在Agent Skills/Claude Code环境中,优先使用Skill内置的脚本路径变量:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" ppt input.pdf output.pptx python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx - 如需更多控制,可追加常用参数:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx --page-ranges "1-3,5" --excel-all-content --excel-worksheet-option for-page python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --enable-ocr --page-layout-mode flow - 启动时,脚本确保存在(若缺失则自动从ComPDF服务器下载),读取
scripts/license.xml字段用于SDK认证,并将<key>目录作为scripts/路径。resource - 若或
--enable-ocr(默认启用)处于激活状态,脚本会检查--enable-ai-layout是否存在;若不存在,会在初始化Document AI模型前自动下载该文件。scripts/documentai.model - 检查返回码;若返回码不是,则根据错误名称处理许可证、密码、资源、模型或输入文件相关问题。
SUCCESS
documentai.model Download Optimization
documentai.model下载优化
- The script preferentially uses the model file pointed to by .
COMPDF_DOCUMENT_AI_MODEL - The default model path is .
scripts/documentai.model - During automatic download, the file is first written to and then atomically renamed to the final file upon success, preventing partial file corruption.
documentai.model.part - On download failure, the script retries automatically with back-off intervals of .
2s / 5s / 10s
- 脚本优先使用指向的模型文件。
COMPDF_DOCUMENT_AI_MODEL - 默认模型路径为。
scripts/documentai.model - 自动下载时,文件先写入,成功后再原子重命名为最终文件,避免文件部分损坏。
documentai.model.part - 下载失败时,脚本会自动重试,退避间隔为。
2s / 5s / 10s
Invoking Directly as a Skill
直接作为Skill调用
- In environments that support Agent Skills, the Skill can be called directly:
text
/pdf-to-word-docx word input.pdf output.docx /pdf-to-word-docx excel input.pdf output.xlsx --excel-worksheet-option for-page - When the Skill receives arguments, it passes them through to the script as-is:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" $ARGUMENTS - If the environment does not support direct Skill invocation, fall back to a regular command-line call.
- 在支持Agent Skills的环境中,可直接调用该Skill:
text
/pdf-to-word-docx word input.pdf output.docx /pdf-to-word-docx excel input.pdf output.xlsx --excel-worksheet-option for-page - Skill收到参数后,会原样传递给脚本:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" $ARGUMENTS - 若环境不支持直接调用Skill,则退回到常规命令行调用方式。
Supported Output Formats
支持的输出格式
- → calls
wordCPDFConversion.start_pdf_to_word - → calls
excelCPDFConversion.start_pdf_to_excel - → calls
pptCPDFConversion.start_pdf_to_ppt - → calls
htmlCPDFConversion.start_pdf_to_html - → calls
rtfCPDFConversion.start_pdf_to_rtf - → calls
imageCPDFConversion.start_pdf_to_image - → calls
txtCPDFConversion.start_pdf_to_txt - → calls
jsonCPDFConversion.start_pdf_to_json - → calls
markdownCPDFConversion.start_pdf_to_markdown - → reuses
csvwith table/Excel parameters to produce CSV-friendly outputCPDFConversion.start_pdf_to_excel
- → 调用
wordCPDFConversion.start_pdf_to_word - → 调用
excelCPDFConversion.start_pdf_to_excel - → 调用
pptCPDFConversion.start_pdf_to_ppt - → 调用
htmlCPDFConversion.start_pdf_to_html - → 调用
rtfCPDFConversion.start_pdf_to_rtf - → 调用
imageCPDFConversion.start_pdf_to_image - → 调用
txtCPDFConversion.start_pdf_to_txt - → 调用
jsonCPDFConversion.start_pdf_to_json - → 调用
markdownCPDFConversion.start_pdf_to_markdown - → 复用
csv并配合表格/Excel参数生成适合CSV的输出CPDFConversion.start_pdf_to_excel
Input Source Types
输入源类型
- The script supports PDF and image as input sources. The SDK's interfaces natively accept image files with no pre-processing required.
start_pdf_to_* - By default, the script auto-detects the input type from the file extension:
- →
.pdfpdf - →
.png/.jpg/.jpeg/.bmp/.tif/.tiff/.gif/.webp/.tgaimage
- You can also specify the source type explicitly:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.png output.docx --source-type image - and
image -> *share the same set ofpdf -> *interfaces; only the input file type differs.CPDFConversion.start_pdf_to_*
- 脚本支持PDF和图片作为输入源。SDK的接口原生支持图片文件输入,无需预处理。
start_pdf_to_* - 默认情况下,脚本会根据文件扩展名自动检测输入类型:
- →
.pdfpdf - →
.png/.jpg/.jpeg/.bmp/.tif/.tiff/.gif/.webp/.tgaimage
- 您也可以显式指定源类型:
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.png output.docx --source-type image - 和
image -> *使用相同的pdf -> *接口集;仅输入文件类型不同。CPDFConversion.start_pdf_to_*
Smart Defaults
智能默认值
The script automatically adjusts certain parameters based on the input source and output format to reduce manual configuration:
| Trigger | Automatic Behavior | User-Overridable | Description |
|---|---|---|---|
Input source is an image (auto-detected or explicit | Automatically enables | No ( | Text in images must be extracted via OCR; without OCR, output will contain only images and no text |
Output format is HTML ( | Automatically sets | Yes — passing | Box layout better preserves the original formatting in HTML; specify |
When triggered, the script prints a notice to , for example:
stderrtext
Auto-enabled OCR for image input.
Auto-set page layout mode to BOX for HTML output.脚本会根据输入源和输出格式自动调整某些参数,减少手动配置:
| 触发条件 | 自动行为 | 用户可覆盖 | 描述 |
|---|---|---|---|
输入源为图片(自动检测或显式指定 | 自动启用 | 否( | 图片中的文本必须通过OCR提取;若不启用OCR,输出将仅包含图片,无文本内容 |
输出格式为HTML( | 自动将 | 是——显式传递 | 框式布局能更好地保留HTML中的原始格式;若需要流式布局,需显式指定 |
触发时,脚本会向打印提示信息,例如:
stderrtext
Auto-enabled OCR for image input.
Auto-set page layout mode to BOX for HTML output.All Parameters
所有参数
Positional Parameters
位置参数
| Parameter | Description |
|---|---|
| Target format: |
| Input file path (PDF or image) |
| Output file path |
| 参数 | 描述 |
|---|---|
| 目标格式: |
| 输入文件路径(PDF或图片) |
| 输出文件路径 |
General Parameters
通用参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Option | | Input source type: |
| String | | PDF open password |
| String | None | Page range, e.g. |
| String | | Output font name |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 选项 | | 输入源类型: |
| 字符串 | | PDF打开密码 |
| 字符串 | None | 页面范围,例如 |
| 字符串 | | 输出字体名称 |
Layout Parameters
布局参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | True | AI layout analysis (disable with |
| Option | SDK default | Page layout: |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | True | AI布局分析(使用 |
| 选项 | SDK默认值 | 页面布局: |
Content Retention Parameters
内容保留参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | True | Retain images (disable with |
| Boolean | True | Retain annotations (disable with |
| Boolean | True | Retain page background images (disable with |
| Boolean | False | Convert formulas to image output |
| Boolean | False | Preserve transparent text |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | True | 保留图片(使用 |
| 布尔值 | True | 保留注释(使用 |
| 布尔值 | True | 保留页面背景图片(使用 |
| 布尔值 | False | 将公式转换为图片输出 |
| 布尔值 | False | 保留透明文本 |
Output Control Parameters
输出控制参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | False | Split output into one document per page |
| Boolean | True | Automatically create output directory (disable with |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | False | 将输出按每页拆分单独文档 |
| 布尔值 | True | 自动创建输出目录(使用 |
OCR Parameters
OCR参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | False (auto-enabled for image input) | Enable OCR |
| Option | SDK default | OCR scope: |
| Multi-select | | OCR language(s); multiple languages can be specified simultaneously. Options: |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | False(图片输入时自动启用) | 启用OCR |
| 选项 | SDK默认值 | OCR范围: |
| 多选 | | OCR语言;可同时指定多种语言。选项: |
Excel-Specific Parameters
Excel专属参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | False | Include all content in Excel output |
| Boolean | False | Output Excel result in CSV format |
| Option | SDK default | Worksheet split strategy: |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | False | 在Excel输出中包含所有内容 |
| 布尔值 | False | 将Excel结果输出为CSV格式 |
| 选项 | SDK默认值 | 工作表拆分策略: |
JSON-Specific Parameters
JSON专属参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | True | Include table data in JSON output (disable with |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | True | 在JSON输出中包含表格数据(使用 |
TXT-Specific Parameters
TXT专属参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Boolean | True | Enable table formatting in TXT output (disable with |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 布尔值 | True | 在TXT输出中启用表格格式化(使用 |
HTML-Specific Parameters
HTML专属参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Option | SDK default | HTML output mode: |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 选项 | SDK默认值 | HTML输出模式: |
Image-Specific Parameters
图片专属参数
| Parameter | Type | Default | Description |
|---|---|---|---|
| Option | SDK default | Image output format: |
| Option | SDK default | Image color mode: |
| Float | | Image scaling factor |
| Boolean | False | Enable image path enhancement |
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| 选项 | SDK默认值 | 图片输出格式: |
| 选项 | SDK默认值 | 图片颜色模式: |
| 浮点数 | | 图片缩放比例 |
| 布尔值 | False | 启用图片路径增强 |
Parameter Default Value Rules
参数默认值规则
- Parameters that default to True (/
--enable-ai-layout/--contain-image/--contain-annotation/--contain-page-background-image/--auto-create-folder/--json-contain-table) use--txt-table-format; passBooleanOptionalActionto disable.--no-xxx - Parameters that default to False (/
--enable-ocr/--formula-to-image/--transparent-text/--output-document-per-page/--excel-all-content/--excel-csv-format) use--image-path-enhance; passing the flag enables them.store_true - All CLI parameter defaults are fully consistent with the SDK's defaults — omitting a parameter is equivalent to using the SDK's original default value.
ConvertOptions()
- 默认值为True的参数(/
--enable-ai-layout/--contain-image/--contain-annotation/--contain-page-background-image/--auto-create-folder/--json-contain-table)使用--txt-table-format;传递BooleanOptionalAction即可禁用。--no-xxx - 默认值为False的参数(/
--enable-ocr/--formula-to-image/--transparent-text/--output-document-per-page/--excel-all-content/--excel-csv-format)使用--image-path-enhance;传递该标志即可启用。store_true - 所有CLI参数默认值与SDK的默认值完全一致——省略参数等效于使用SDK的原始默认值。
ConvertOptions()
Recommended Command Examples
推荐命令示例
PDF to Word (default parameters, AI layout analysis enabled)
PDF转Word(默认参数,启用AI布局分析)
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docxbash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docxPDF to Word, box layout, no images, no AI layout analysis
PDF转Word,框式布局,不含图片,禁用AI布局分析
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --no-enable-ai-layout --no-contain-image --page-layout-mode boxbash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --no-enable-ai-layout --no-contain-image --page-layout-mode boxPDF to Word, retain annotations and background images, one document per page
PDF转Word,保留注释和背景图片,按每页拆分文档
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --output-document-per-pagebash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --output-document-per-pagePDF to Excel, include all content and split worksheets by page
PDF转Excel,包含所有内容并按页面拆分工作表
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx --excel-all-content --excel-worksheet-option for-pagebash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" excel input.pdf output.xlsx --excel-all-content --excel-worksheet-option for-pagePDF to TXT, with table formatting enabled
PDF转TXT,启用表格格式化
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" txt input.pdf output.txtbash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" txt input.pdf output.txtPDF to HTML, multi-page with bookmarks mode
PDF转HTML,带书签的多页模式
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" html input.pdf output_dir --html-option multiple-page-with-bookmarkbash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" html input.pdf output_dir --html-option multiple-page-with-bookmarkPDF to Image, PNG format, grayscale, 2x scaling
PDF转图片,PNG格式,灰度,2倍缩放
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" image input.pdf output.png --image-type png --image-color-mode gray --image-scaling 2.0bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" image input.pdf output.png --image-type png --image-color-mode gray --image-scaling 2.0Image to Word (OCR auto-enabled, specify Chinese language)
图片转Word(自动启用OCR,指定中文语言)
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.png output.docx --ocr-language chineseNote: For image input, the script automatically enables OCR — there is no need to passmanually. To specify an OCR language,--enable-ocrcan still be used.--ocr-language
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.png output.docx --ocr-language chinese注意:对于图片输入,脚本会自动启用OCR——无需手动传递。若要指定OCR语言,仍可使用--enable-ocr参数。--ocr-language
PDF with OCR enabled (multiple languages)
启用OCR的PDF转换(多语言)
bash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --enable-ocr --ocr-language chinese english japanesebash
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" word input.pdf output.docx --enable-ocr --ocr-language chinese english japaneseTrial License and Usage Limits
试用许可证及使用限制
- The auto-downloaded from the ComPDF server is a Trial License, allowing a maximum of 200 conversions.
scripts/license.xml - The script uses a SHA-256 fingerprint to detect whether the current License is the default trial key; no usage limit applies when using any other License.
- After each successful conversion using the trial License, the script prints the current used/remaining count to , for example:
stderrtextTrial license: 5/200 conversions used, 195 remaining. - When the trial limit is reached (200 conversions), the script refuses to convert and prompts the user to purchase a full License:
text
Error: Trial license usage limit reached (200 conversions). Please purchase a license at: https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills - When the trial License has expired (SDK authentication fails), the error message also includes a purchase link.
- After purchasing a full License, place a custom containing the new
license.xmlin<key>(overwriting the auto-downloaded trial file) — no script modifications or counter file cleanup are required.scripts/
- 从ComPDF服务器自动下载的是试用许可证,最多允许200次转换。
scripts/license.xml - 脚本使用SHA-256指纹检测当前许可证是否为默认试用密钥;使用其他任何许可证时无使用限制。
- 使用试用许可证完成每次成功转换后,脚本会向打印当前已使用/剩余次数,例如:
stderrtextTrial license: 5/200 conversions used, 195 remaining. - 当试用限制达到(200次转换)时,脚本会拒绝转换并提示用户购买完整许可证:
text
Error: Trial license usage limit reached (200 conversions). Please purchase a license at: https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills - 当试用许可证过期(SDK认证失败)时,错误信息也会包含购买链接。
- 购买完整许可证后,将包含新的自定义
<key>放置在license.xml目录中(覆盖自动下载的试用文件)——无需修改脚本或清理计数器文件。scripts/
Confirmed Facts
已确认事实
- has been successfully installed on the local machine.
ComPDFKitConversion - The installed package provides 10 conversion methods including .
CPDFConversion.start_pdf_to_word/start_pdf_to_ppt/start_pdf_to_excel - provides
LibraryManager,initialize,license_verify,release, andset_document_ai_model.set_ocr_language - Official documentation confirms support for PDF to Word / Excel / PPT / HTML / RTF / Image / TXT / JSON / Markdown.
- The SDK's interfaces natively accept image file input (PNG → Word has been verified successfully).
start_pdf_to_* - defaults to
enable_ai_layoutin the SDK;Truemust be called first to load the model before use, otherwise a 0xC0000005 crash will occur.set_document_ai_model() - supports specifying multiple languages simultaneously (e.g.
--ocr-language).--ocr-language chinese english
- 已成功安装在本地机器上。
ComPDFKitConversion - 已安装的包提供10种转换方法,包括。
CPDFConversion.start_pdf_to_word/start_pdf_to_ppt/start_pdf_to_excel - 提供
LibraryManager、initialize、license_verify、release和set_document_ai_model方法。set_ocr_language - 官方文档确认支持PDF转Word/Excel/PPT/HTML/RTF/图片/TXT/JSON/Markdown。
- SDK的接口原生支持图片文件输入(PNG转Word已验证成功)。
start_pdf_to_* - SDK中默认值为
enable_ai_layout;使用前必须先调用True加载模型,否则会发生0xC0000005崩溃。set_document_ai_model() - 支持同时指定多种语言(例如
--ocr-language)。--ocr-language chinese english
Risks / Notes
风险/注意事项
- The official requirements page states Python , while the demo page states
>=3.6, but PyPI currently provides a<3.11wheel in practice; treat the locally installable wheel as the source of truth, but always verify installation in a new environment first.cp314 - If the script cannot download from the server (network issue) and no manual file exists in
license.xml, or thescripts/field is empty, the script cannot complete SDK authentication and cannot perform any real conversions.<key> - is a large file (approximately 525 MB); there will be a noticeable download delay the first time OCR / AI layout is enabled. Because
documentai.modeldefaults to True, the model download will be triggered on the very first run.--enable-ai-layout - If the runtime environment cannot access , place
https://download.compdf.com/skills/model/documentai.modelin thedocumentai.modeldirectory in advance.scripts/ - Do not directly apply the initialization patterns from ComPDF SDKs for other languages to the Python package; this Skill is based on the locally verified /
LibraryManagerAPI.CPDFConversion
- 官方要求页面说明Python版本,而演示页面说明
>=3.6,但PyPI实际提供<3.11版本的wheel包;以本地可安装的wheel包为准,但在新环境中始终要先验证安装情况。cp314 - 若脚本无法从服务器下载(网络问题)且
license.xml目录中无手动放置的文件,或scripts/字段为空,脚本无法完成SDK认证,无法执行任何实际转换。<key> - 是大文件(约525 MB);首次启用OCR/AI布局时会有明显的下载延迟。由于
documentai.model默认启用,首次运行时会触发模型下载。--enable-ai-layout - 若运行环境无法访问,请提前将
https://download.compdf.com/skills/model/documentai.model放置在documentai.model目录中。scripts/ - 不要将其他语言的ComPDF SDK初始化模式直接应用于Python包;本Skill基于本地验证的/
LibraryManagerAPI开发。CPDFConversion
Resource Navigation
资源导航
- License file:
License.txt - Script:
scripts/pdf-to-word-docx.py - SDK authentication file: (auto-downloaded from
scripts/license.xmlif missing)https://download.compdf.com/skills/license/license.xml - SDK authentication source: the field in
<key>license.xml - SDK resource path:
scripts/ - OCR / AI layout model: (auto-downloaded if missing)
scripts/documentai.model - Purchase a full License:
https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills - Official documentation:
https://www.compdf.com/guides/conversion-sdk/python/overviewhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-wordhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-excelhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-ppthttps://www.compdf.com/guides/conversion-sdk/python/apply-license
- 许可证文件:
License.txt - 脚本:
scripts/pdf-to-word-docx.py - SDK认证文件:(若缺失则从
scripts/license.xml自动下载)https://download.compdf.com/skills/license/license.xml - SDK认证来源:中的
license.xml字段<key> - SDK资源路径:
scripts/ - OCR/AI布局模型:(若缺失则自动下载)
scripts/documentai.model - 购买完整许可证:
https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills - 官方文档:
https://www.compdf.com/guides/conversion-sdk/python/overviewhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-wordhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-excelhttps://www.compdf.com/guides/conversion-sdk/python/pdf-to-ppthttps://www.compdf.com/guides/conversion-sdk/python/apply-license
Acceptance Checklist
验收 checklist
- shows the installed package
python -m pip show ComPDFKitConversion - Running or an equivalent local command produces normal output
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" --help - The script auto-downloads if missing, then extracts the license key from the
scripts/license.xmlfield for authentication<key> - The script uses the directory as the SDK resource path
scripts/ - The script recognizes all 10 target formats: /
word/excel/ppt/html/rtf/image/txt/json/markdowncsv - The script accepts both PDF and image files (/
.png/.jpg/.jpeg/.bmp/.tif/.tiff/.gif/.webp) as input.tga - When or
--enable-ocr(enabled by default) is active and--enable-ai-layoutis missing, the script auto-downloads the modeldocumentai.model - When cannot be obtained (download fails and no manual file exists) or authentication fails, a clear error is output rather than a silent failure
license.xml - The 7 parameters that default to True can be disabled with
--no-xxx - supports specifying multiple languages simultaneously
--ocr-language - After a conversion using the trial License, the usage count increments
- When the trial License reaches 200 conversions, the script refuses to convert and outputs a purchase link
- When using a non-trial License, no usage limit applies
- For image input, even if is not passed, the script automatically enables OCR and prints a notice to
--enable-ocrstderr - For HTML output, even if is not passed, the script automatically uses
--page-layout-mode(box layout) and prints a notice toboxstderr - For HTML output, explicitly passing overrides the automatic box layout behavior
--page-layout-mode flow
- 显示已安装的包
python -m pip show ComPDFKitConversion - 运行或等效本地命令能正常输出
python "${CLAUDE_SKILL_DIR}/scripts/pdf-to-word-docx.py" --help - 若缺失,脚本会自动下载,然后从
scripts/license.xml字段提取许可证密钥进行认证<key> - 脚本将目录用作SDK资源路径
scripts/ - 脚本识别所有10种目标格式:/
word/excel/ppt/html/rtf/image/txt/json/markdowncsv - 脚本接受PDF和图片文件(/
.png/.jpg/.jpeg/.bmp/.tif/.tiff/.gif/.webp)作为输入.tga - 当或
--enable-ocr(默认启用)激活且--enable-ai-layout缺失时,脚本自动下载模型documentai.model - 若无法获取(下载失败且无手动文件)或认证失败,输出清晰错误而非静默失败
license.xml - 7个默认值为True的参数可通过禁用
--no-xxx - 支持同时指定多种语言
--ocr-language - 使用试用许可证完成转换后,使用次数递增
- 当试用许可证达到200次转换时,脚本拒绝转换并输出购买链接
- 使用非试用许可证时无使用限制
- 对于图片输入,即使未传递,脚本也会自动启用OCR并向
--enable-ocr打印提示stderr - 对于HTML输出,即使未传递,脚本也会自动使用
--page-layout-mode(框式布局)并向box打印提示stderr - 对于HTML输出,显式传递会覆盖自动框式布局行为
--page-layout-mode flow
Distribution Notes
分发说明
- This Skill does not depend on any machine-specific absolute paths.
- When distributing to other users, the following directory structure is sufficient:
text
pdf-to-word-docx/ ├── SKILL.md ├── License.txt └── scripts/ └── pdf-to-word-docx.py - Users place this directory under their own skills root directory and the Skill is ready to use.
- is auto-downloaded at runtime; no need to include it in the distribution package.
license.xml
- 本Skill不依赖任何机器特定的绝对路径。
- 分发给其他用户时,以下目录结构即可:
text
pdf-to-word-docx/ ├── SKILL.md ├── License.txt └── scripts/ └── pdf-to-word-docx.py - 用户将此目录放置在自己的技能根目录下即可使用。
- 会在运行时自动下载;无需包含在分发包中。
license.xml
Common Pitfalls
常见陷阱
- is missing and cannot be auto-downloaded (network unavailable or server error): the script will error out before authentication. If you are in an offline environment, place
scripts/license.xmlmanually in thelicense.xmldirectory.scripts/ - is missing the
scripts/license.xmlfield or its value is empty: the script will error out before authentication.<key> - SDK resource files required by the SDK are absent from the directory: conversion may fail after
scripts/.LibraryManager.initialize() - A password-protected PDF is provided without : this will trigger
--password.PDF_PASSWORD_ERROR - OCR / AI layout is enabled but is not present locally and the network is unavailable: the model download will fail; place the file in the
documentai.modeldirectory manually in advance.scripts/ - When the Excel output strategy is unclear, prefer passing explicitly to avoid unexpected result structures.
--excel-worksheet-option - When converting images to other formats, the script already enables OCR automatically; if the output still contains no text, check whether is complete and whether the OCR language matches.
documentai.model - Once the trial License usage limit is exhausted, a full License must be purchased to continue; purchase link: .
https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills
- 缺失且无法自动下载(网络不可用或服务器错误):脚本会在认证前报错。若处于离线环境,请手动将
scripts/license.xml放置在license.xml目录中。scripts/ - 缺少
scripts/license.xml字段或值为空:脚本会在认证前报错。<key> - SDK所需的SDK资源文件在目录中缺失:
scripts/后转换可能失败。LibraryManager.initialize() - 提供了受密码保护的PDF但未传递:会触发
--password。PDF_PASSWORD_ERROR - 启用了OCR/AI布局但本地无且网络不可用:模型下载会失败;请提前手动将文件放置在
documentai.model目录中。scripts/ - 若对Excel输出策略不明确,优先显式传递以避免意外的结果结构。
--excel-worksheet-option - 将图片转换为其他格式时,脚本已自动启用OCR;若输出仍无文本,请检查是否完整以及OCR语言是否匹配。
documentai.model - 试用许可证使用限制耗尽后,必须购买完整许可证才能继续;购买链接:。
https://www.compdf.com/contact-sales?utm_source=clawhub&utm_medium=skillhub&utm_campaign=pdf_skill_to_word&ref_platform_id=clawhub_skills
Copyright
版权声明
This Skill is built on top of the ComPDFKit Conversion SDK.
© 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.- SDK Name: ComPDFKitConversion
- SDK Author: PDF Technologies, Inc.
- License Type: Commercial License (Commercial / Proprietary) — non-exclusive, non-transferable, non-sublicensable, revocable
- Official Website: https://www.compdf.com/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
- Contact: support@compdf.com
- Terms of Service: https://www.compdf.com/terms-of-service/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
- Privacy Policy: https://www.compdf.com/privacy-policy/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
Important: Under the ComPDFKit Terms of Service, distributing the documentation, sample code, or source code of the ComPDFKit Conversion SDK to third parties is prohibited. Please ensure you have obtained a valid ComPDFKit License before using this Skill.
本Skill基于ComPDFKit Conversion SDK构建。
© 2014-2026 PDF Technologies, Inc., a KDAN Company. All Rights Reserved.- SDK名称:ComPDFKitConversion
- SDK作者:PDF Technologies, Inc.
- 许可证类型:商业许可证(Commercial / Proprietary)——非独占、不可转让、不可再许可、可撤销
- 官方网站:https://www.compdf.com/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
- 联系方式:support@compdf.com
- 服务条款:https://www.compdf.com/terms-of-service/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
- 隐私政策:https://www.compdf.com/privacy-policy/?utm_source=clawhub&utm_medium=skillhub&utm_campaign=compdf_pdf_skill_to_word&ref_platform_id=clawhub_skills
重要提示:根据ComPDFKit服务条款,禁止向第三方分发ComPDFKit Conversion SDK的文档、示例代码或源代码。使用本Skill前请确保已获取有效的ComPDFKit许可证。