Pdf Watermark Chinese
PDF 水印添加和移除功能,支持文本和图像水印
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 23 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The skill name/description (PDF watermark add/remove, text and image, Chinese support) matches the included code and SKILL.md. The code implements text/image watermarking, has Chinese font detection/registration logic, and a CLI in pdf_watermark_chinese.py — all coherent with the declared purpose.
Instruction Scope
SKILL.md and the source instruct the agent to read and write PDF and image files and to detect/register local fonts. The code reads local font files and calls fc-list for font discovery; these are in-scope for supporting Chinese text rendering. There are no instructions to send data to external endpoints or to read unrelated credentials or system secrets.
Install Mechanism
There is no install spec (instruction-only installation). Included are plain Python files with standard library usage and dependencies on PyPDF2/reportlab. No external archives, unknown download URLs, or extract steps are present.
Credentials
The skill requests no environment variables or credentials. It accesses local filesystem paths (PDFs, images, font files) and runs a benign subprocess call to fc-list to discover fonts — behavior consistent with supporting Chinese font rendering. No unrelated secrets or services are requested.
Persistence & Privilege
always:false and default invocation settings are used. The skill does not request permanent platform-wide privileges, nor does it modify other skills' configurations in the provided code.
Assessment
This skill appears to do what it says: add/remove text and image watermarks and support Chinese fonts. Before installing, note: (1) you must have PyPDF2 and reportlab available (the skill doesn't auto-install them); (2) the code reads and writes files you provide and probes local font files (it runs fc-list and checks common font paths) — this is normal for Chinese font support but means it will access your filesystem; (3) there are no network calls or credential requirements in the provided files; (4) review pdf_watermark.py (the larger file) if you want to confirm the 'remove watermark' and batch-processing implementations and to ensure it matches your expectations. Run the tool on non-sensitive files first and ensure file permissions/paths are what you expect.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
PDF 水印技能
功能
- 添加文本水印到 PDF
- 添加图像水印到 PDF
- 移除 PDF 中的水印
- 批量处理 PDF 文件
使用方法
添加文本水印
说:"给这个PDF添加水印 '机密文件'"
或:"在PDF上添加水印,文字是公司名称,位置在右下角"
添加图像水印
说:"给PDF添加logo水印"
或:"用这个图片作为PDF水印"
移除水印
说:"移除这个PDF的水印"
或:"清除PDF中的所有水印"
技术依赖
- PyPDF2: PDF 操作
- reportlab: PDF 生成和水印绘制
- Python 3.8+
示例代码
from PyPDF2 import PdfReader, PdfWriter
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
import io
def add_text_watermark(input_pdf, output_pdf, watermark_text):
"""添加文本水印到PDF"""
reader = PdfReader(input_pdf)
writer = PdfWriter()
for page_num in range(len(reader.pages)):
page = reader.pages[page_num]
# 创建水印
packet = io.BytesIO()
can = canvas.Canvas(packet, pagesize=letter)
can.setFont("Helvetica", 40)
can.setFillColorRGB(0.5, 0.5, 0.5, alpha=0.3) # 灰色,半透明
can.rotate(45)
can.drawString(200, 100, watermark_text)
can.save()
# 合并水印
packet.seek(0)
watermark = PdfReader(packet)
watermark_page = watermark.pages[0]
page.merge_page(watermark_page)
writer.add_page(page)
with open(output_pdf, "wb") as output_file:
writer.write(output_file)
文件格式支持
- 输入: PDF 文件
- 输出: 带水印的 PDF 文件
- 水印类型: 文本、图像 (PNG, JPG)
配置选项
- 水印文字、字体、大小、颜色、透明度
- 水印位置: 居中、四角、平铺
- 水印旋转角度
- 页面范围: 所有页、特定页
Files
3 totalSelect a file
Select a file to preview.
Comments
Loading comments…
