← 返回
未分类

图片合并到 word

This skill should be used when the user wants to collect images from a directory and assemble them into a Word (.docx) document — one image per page — with optional ruled writing lines at the bottom of each page. Trigger phrases include: "把图片放到 Word 文档", "图片合并到 word", "生成图片文档", "images to docx", "collect images into word".
This skill should be used when the user wants to collect images from a directory and assemble them into a Word (.docx) document — one image per page — with optional ruled writing lines at the bottom of each page. Trigger phrases include: "把图片放到 Word 文档", "图片合并到 word", "生成图片文档", "images to docx", "collect images into word".
海宏
未分类 community v1.0.1 2 版本 100000 Key: 无需
★ 0
Stars
📥 96
下载
💾 0
安装
2
版本
#latest

概述

jyw-images-to-docx

Assemble all images in a workspace directory into a Word document with one

image per page (A4, 0.5-inch margins). Each page optionally reserves a ruled

writing area at the bottom for handwritten annotations.

Supported Formats

PNG · JPG/JPEG · GIF · BMP · SVG

Core Script

scripts/create_doc.js — Node.js script (requires the docx npm package).

Prerequisites

The docx npm package must be installed globally (one-time setup):

npm install -g docx

Skip this step if docx is already listed in npm ls -g --depth=0.


Usage

Basic Usage

node scripts/create_doc.js "<WORKSPACE_DIR>"

Important: NODE_PATH

Set NODE_PATH to the global node_modules directory so that the

skill script can resolve the docx package:

NODE_PATH="$(npm root -g)" node scripts/create_doc.js "<WORKSPACE_DIR>"

Request Parameters

ArgumentRequiredDefaultDescription
----------------------------------------------------------------------------------
workspace_dirCurrent workspace root
output_file/images_collection.docxOutput file path
writing_lines5Ruled lines per page
image_ratio0.68Image height as fraction of page

Examples

# Basic usage
node scripts/create_doc.js "/path/to/workspace"

# Custom output file
node scripts/create_doc.js "/path/to/workspace" "/path/to/workspace/output.docx"

# Full options: custom output, 3 lines per page, 75% image height
node scripts/create_doc.js "/path/to/workspace" "/path/to/workspace/output.docx" 3 0.75

Output

The script generates a .docx file containing all images from the workspace,

one image per page, with optional ruled writing lines at the bottom of each page.

Images are sorted alphabetically by filename. Images that cannot have their

dimensions parsed fall back to 800×600.

Report to the user:

  • Full path of the generated .docx file
  • Number of pages / images included
  • Any images that were skipped (unsupported format or unreadable file)

Post-Generation Behavior

When running in WorkBuddy: Do NOT call open_result_view or deliver_attachments after generating the .docx file. Simply report the result to the user in text (file path, page count, skipped images). This avoids triggering WorkBuddy's artifact download panel.

When running in other AI agents, follow their normal file presentation conventions.

Notes

  • Unless the user explicitly requests specific values for output_file, writing_lines, or image_ratio, always use the script's built-in defaults (omit those arguments entirely). Do NOT override defaults on your own.
  • The docx package should be installed globally (npm install -g docx). Do NOT install it locally in the workspace.
  • The script already handles image discovery (scanning the workspace directory for supported formats). Do NOT pre-scan or count images before running the script — just execute it directly.
  • To change the number of writing lines per page, pass a different writing_lines value.

版本历史

共 2 个版本

  • v1.0.1 修正 Usage 段落中的脚本路径引用:skills/images-to-docx/scripts/create_doc.js → scripts/create_doc.js,与 Examples 段落统一,消除对上层目录结构的依赖。 当前
    2026-05-23 15:17 安全 安全
  • v1.0.0 Unless the user explicitly requests specific values for output_file, writing_lines, or image_ratio, always use the script's built-in defaults (omit those arguments entirely). Do NOT override defaults on your own. The docx package should be installed globally (npm install -g docx). Do NOT install it locally in the workspace. The script already handles image discovery (scanning the workspace directory for supported formats). Do NOT pre-scan or count images before running the script — just execute it directly. To change the number of writing lines per page, pass a different writing_lines value.
    2026-05-23 14:17 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

玖月伍 图片水印工具

user_565bc8fb
基于 DCT 域差分编码 + 圆角保护 + 像素指纹的三层版权证据体系。 输入支持 PNG / JPG / JPEG / BMP / TIFF / GIF(仅静态) / WEBP(仅静态), 不支持动图(GIF/WEBP 多帧会拒绝
★ 0 📥 83
office-efficiency

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 400 📥 150,175
office-efficiency

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 937 📥 188,045