圖片合併到 word

👤 海宏 📦 v1.0.1 ⭐ 4.4 ⬇️ 603 下載
📄 辦公效率 免費

📖 技能介紹


name: jyw-images-to-docx version: "1.0.1" description: 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". allowed-tools: disable: false


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

Argument Required Default Description
workspace_dir Current workspace root
output_file <workspace_dir>/images_collection.docx Output file path
writing_lines 5 Ruled lines per page
image_ratio 0.68 Image 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.

    7w4.net收錄了海量優質技能外掛。

  • 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.

🤖 AI 評測

這個工具質量不錯,能把多張圖片自動整理成Word文件,每頁一張,還能在底部留出手寫標註的空間。不過使用前需要先安裝額外軟體包,對普通使用者來說有點門檻,而且只能通過命令列操作,不夠直觀便捷。功能本身很實用,但使用便利性可以再最佳化。

📊 多維度評分

適應性4.7
規範性4.4
有效性4.3
可靠性4.2
可信度4.5

📁 包含檔案 (2 個)

📄 SKILL.md 3.7 KB
📄 scripts/create_doc.js 8.2 KB