360 Secure SkillHub
360 安全技能中心

URL to PDF

给定网页 URL,运行基于 uv 与 Playwright 的 Python 脚本渲染页面并导出适合手机阅读的 PDF;脚本在 stdout 打印 PDF 路径,随后由 Agent 通过 message 工具以文档形式发送给用户。

分类:效率
guoqiao
guoqiao
热度 50.50
最近更新 2026-05-11 16:01:18

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add guoqiao/url2pdf
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
url2pdf
description
Convert URL to PDF suitable for mobile reading.
author
guoqiao
metadata
{"openclaw":{"always":true,"emoji":"🦞","homepage":"https://clawhub.ai/guoqiao/url2pdf","os":["darwin","linux","win32"],"requires":{"bins":["uv"]}}}
triggers
["/url2pdf <url>","Save this url as pdf","Convert to pdf for mobile"]

URL to PDF

Given a url for a webpage, convert it to pdf suitable for mobile reading.

See examples.

Requirements

  • uv

Installation

playwright itself will be installed by uv automatically, while it also needs browser to be installed:

uvx playwright install chromium

Usage

uv run --script ${baseDir}/url2pdf.py "${url}"

Path to pdf will be printed to stdout.

Agent Instructions

  1. Run the script: Pass the url to be converted as an argument.
  2. Handle Output: The script will output a path to a pdf file. Use the message tool to send the pdf file to the user as a document message:
{
   "action": "send",
   "filePath": "<filepath>"
}