wps-attendance
考勤打卡统计。把考勤机导出的打卡数据丢进来,自动统计每个人的 迟到、早退、缺勤、加班时长,生成月度考勤汇总表,异常考勤自动标红。 用于帮助HR处理考勤数据。当用户提到考勤、打卡、迟到、加班统计时触发。 Attendance tracker - generates summary reports from…
文档加水印。给Word或PDF文档加上"机密""内部资料""草稿""仅供XX查阅"等文字水印, 支持自定义文字、角度、透明度。提供python脚本和WPS宏两种方式。 用于帮助用户保护文档。当用户提到水印、加水印、机密标记时触发。 Adds text watermarks to Word and PDF documents.
$ npx -y skills add Bwkyd/wps-skills --skill wps-watermark --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/wps-watermarkContext preview
The summary Claude sees to decide when to auto-load this skill.
文档加水印。给Word或PDF文档加上"机密""内部资料""草稿""仅供XX查阅"等文字水印, 支持自定义文字、角度、透明度。提供python脚本和WPS宏两种方式。 用于帮助用户保护文档。当用户提到水印、加水印、机密标记时触发。 Adds text watermarks to Word and PDF documents.
name: wps-watermark
description: |
文档加水印。给Word或PDF文档加上"机密""内部资料""草稿""仅供XX查阅"等文字水印,
支持自定义文字、角度、透明度。提供python脚本和WPS宏两种方式。
用于帮助用户保护文档。当用户提到水印、加水印、机密标记时触发。
Adds text watermarks to Word and PDF documents.
license: MIT
user-invocable: true
argument-hint: '[文件路径] [水印文字]'
allowed-tools: 'Read, Grep, Glob, Bash, Write, Edit'
metadata:
author: BWKYD
title: 文档加水印
description_zh: 给Word或PDF文档添加文字水印,如机密、内部、草稿等
tags:
- 水印
- 文档保护
- 安全
- python-docx
- WPS
version: 1.0.1
license: MIT一键为文档添加水印。"机密""草稿""内部"随你选。
[1] 文字水印 → "机密""内部资料""草稿""DRAFT""CONFIDENTIAL" [2] 图片水印 → 公司Logo等 [3] 日期水印 → 自动添加日期 [4] 个人水印 → "仅供XX查阅"
**Word文档水印:**
from docx import Document
from docx.oxml.ns import qn, nsdecls
from docx.oxml import parse_xml
import os
def add_watermark_to_word(doc_path, text='机密', output_path=None):
"""为Word文档添加文字水印"""
doc = Document(doc_path)
# 通过页眉添加水印(兼容性最好的方式)
for section in doc.sections:
header = section.header
header.is_linked_to_previous = False
# 创建水印shape
watermark_xml = f'''
<w:r {nsdecls('w', 'wp', 'v', 'o', 'mc', 'r')}>
<mc:AlternateContent>
<mc:Choice Requires="wps">
<w:drawing>
<wp:anchor distT="0" distB="0" distL="0" distR="0"
simplePos="0" relativeHeight="251658240"
behindDoc="1" locked="0" layoutInCell="1"
allowOverlap="1">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="page">
<wp:align>center</wp:align>
</wp:positionH>
<wp:positionV relativeFrom="page">
<wp:align>center</wp:align>
</wp:positionV>
<wp:extent cx="5400000" cy="2700000"/>
<wp:wrapNone/>
</wp:anchor>
</w:drawing>
</mc:Choice>
</mc:AlternateContent>
</w:r>'''
# 简化方式:在页眉添加灰色大字作为视觉水印
p = header.paragraphs[0] if header.paragraphs else header.add_paragraph()
p.alignment = 1 # CENTER
run = p.add_run(text)
run.font.size = 7200000 # 大字
run.font.color.rgb = None # 需要设置透明
if not output_path:
base, ext = os.path.splitext(doc_path)
output_path = f'{base}_watermarked{ext}'
doc.save(output_path)
return os.path.abspath(output_path)
def add_watermark_to_pdf(pdf_path, text='机密', output_path=None):
"""为PDF添加文字水印"""
import fitz # PyMuPDF
doc = fitz.open(pdf_path)
for page in doc:
rect = page.rect
# 在页面中心添加斜置文字
text_point = fitz.Point(rect.width / 4, rect.height / 2)
page.insert_text(
text_point, text,
fontsize=60,
color=(0.8, 0.8, 0.8), # 浅灰色
rotate=-45,
)
if not output_path:
base, ext = os.path.splitext(pdf_path)
output_path = f'{base}_watermarked{ext}'
doc.save(output_path)
doc.close()
return os.path.abspath(output_path)**JSA宏方式(WPS Writer中直接运行):**
// JSA: 添加文字水印到WPS文档
function AddWatermark() {
var doc = Application.ActiveDocument;
var text = "机密";
// 通过页眉添加水印
var header = doc.Sections.Item(1).Headers.Item(1);
var shape = header.Shapes.AddTextEffect(
0, // msoTextEffect1
text,
"宋体",
72, // 字号
false, // 不加粗
false, // 不斜体
0, 0 // 位置
);
shape.TextEffect.NormalizedHeight = false;
shape.Line.Visible = false;
shape.Fill.Visible = true;
shape.Fill.ForeColor.RGB = 0xD0D0D0; // 浅灰
shape.Fill.Transparency = 0.7;
shape.Rotation = -45;
shape.Left = 100;
shape.Top = 200;
shape.Width = 400;
shape.Height = 200;
shape.WrapFormat.Type = 3; // wdWrapBehind
Application.alert("水印已添加!");
}1. 生成添加水印后的文档 2. 说明水印位置和样式 3. 提醒:文字水印可被编辑删除,不能替代加密保护
# 添加机密水印 /wps-watermark 给report.docx加个"机密"水印 # 草稿标记 /wps-watermark 标记为草稿 draft_v2.docx # PDF水印 /wps-watermark 给合同.pdf加水印"仅供内部使用" # 自定义 /wps-watermark 加水印"仅供张三查阅"到proposal.docx
42 个 WPS Office 办公自动化 Claude Code Skills 集合 一句话指令,让 Claude 帮你自动生成 Word / Excel / PPT / PDF 文档。
Repo: Bwkyd/wps-skills
考勤打卡统计。把考勤机导出的打卡数据丢进来,自动统计每个人的 迟到、早退、缺勤、加班时长,生成月度考勤汇总表,异常考勤自动标红。 用于帮助HR处理考勤数据。当用户提到考勤、打卡、迟到、加班统计时触发。 Attendance tracker - generates summary reports from…
文档批量格式转换。把一个文件夹里的Word全转文本、Excel全导出CSV、 Markdown转Word,支持docx/txt/xlsx/csv/md等格式批量互转,一次搞定。 用于帮助用户批量转换文档格式。当用户提到批量转换、格式转换、导出时触发。 Batch converts documents between…
预算表一键生成。部门年度预算、项目预算、活动经费预算,选个模板填数字就行, 小计合计公式自动写好,还有预算vs实际对比和执行率自动计算。 用于帮助财务和行政制作预算表。当用户提到预算、费用表、经费时触发。 Budget spreadsheet generator with formulas and variance…
证书奖状批量生成。给一份名单,批量生成荣誉证书、结业证书、聘书、感谢信, 每人一份独立文件,年终评优、培训结业、表彰活动必备工具。 用于帮助用户批量生成证书。当用户提到证书、奖状、聘书时触发。 Batch certificate/award generator from a list of recipients.
数据图表一键生成。不知道数据该用什么图表?告诉我你的数据和目的, 自动推荐最佳图表类型并生成,柱状图折线图饼图散点图都支持,还帮你调配色。 用于帮助用户制作数据可视化图表。当用户提到图表、柱状图、折线图、饼图时触发。 Chart generator - recommends best chart type and…
日历排班值班表。生成带法定节假日和调休标注的月度/年度日历表, 还能做三班倒/两班倒排班表和节假日值班安排,颜色区分不同班次一目了然。 用于帮助用户生成日历和排班表。当用户提到日历、排班、值班、节假日时触发。 Chinese calendar with holidays, shift scheduling, and…