export-pdf
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "export-pdf" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-6a639f68c08ebf8aae79d4ef21b0404a60efd0b81c467228789434e41c16e85e. Verify the upstream source and version against https://github.com/bluzir/claude-code-design before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Tool to export HTML resources to PDF using headless Chromium (puppeteer Page.pdf). For multi-page slides, each <section> corresponds to one page.
Introduction source: third_party · bluzir · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Export an HTML artifact to PDF via headless Chromium (puppeteer Page.pdf). For multi-slide decks one page per <section>.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: export-pdf
description: Export an HTML artifact to PDF via headless Chromium (puppeteer Page.pdf). For multi-slide decks one page per <section>.
argument-hint: <html-path> [output.pdf]
allowed-tools: Read Write Bash(node:*) Bash(realpath:*) Bash(mkdir:*) Bash(which:*) Bash(stat:*) Bash(ls:*)Export PDF
Produce a PDF from an HTML artifact. Uses puppeteer's Page.pdf() which is lossless vector when the source is HTML/CSS/SVG.
Why puppeteer instead of Chrome DevTools MCP: the MCP does not expose Page.printToPDF directly (only take_screenshot, list_console_messages, evaluate_script, etc.). Using puppeteer via a Node script is deterministic and matches /export-pptx.
Preflight
Bash(which node)— requiredBash(test -d node_modules/puppeteer && echo yes || echo no)— if no, tell user/doctoror runnpm i -D puppeteer
Steps
-
Resolve paths:
$0= input HTML (required)$1= output (default: input with.pdfextension)Bash(mkdir -p $(dirname <output>))if needed
-
Run export script:
Bash(node scripts/export-pdf.mjs "<input>" "<output>")(The script exists at
scripts/export-pdf.mjs; if missing, write it per the template below.) -
Report size + path.
Script template (scripts/export-pdf.mjs)
#!/usr/bin/env node
// Usage: node export-pdf.mjs <input.html> [output.pdf]
import puppeteer from 'puppeteer';
import { pathToFileURL } from 'node:url';
import path from 'node:path';
import fs from 'node:fs/promises';
const [, , input, output = input.replace(/\.html?$/i, '.pdf')] = process.argv;
if (!input) { console.error('Usage: export-pdf.mjs <input.html> [output.pdf]'); process.exit(1); }
const inAbs = path.resolve(process.cwd(), input);
const outAbs = path.resolve(process.cwd(), output);
const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
const page = await browser.newPage();
await page.goto(pathToFileURL(inAbs).toString(), { waitUntil: 'networkidle0' });
// If it's a deck, set noscale so deck-stage renders at natural dims
const deckDims = await page.evaluate(() => {
const d = document.querySelector('deck-stage');
if (!d) return null;
d.setAttribute('noscale', '');
return [parseInt(d.getAttribute('width') || '1920', 10), parseInt(d.getAttribute('height') || '1080', 10)];
});
await page.emulateMediaType('print');
const pdfOpts = {
path: outAbs,
printBackground: true,
};
if (deckDims) {
// Deck: one section per page — @media print in deck_stage.js handles page-break
pdfOpts.width = `${deckDims[0]}px`;
pdfOpts.height = `${deckDims[1]}px`;
pdfOpts.pageRanges = '';
} else {
pdfOpts.format = 'A4';
}
await page.pdf(pdfOpts);
await browser.close();
const stat = await fs.stat(outAbs);
console.log(`wrote ${outAbs} (${(stat.size / 1024).toFixed(1)} KB)`);
Notes
- For decks: deck_stage.js must have
@media print { @page { size: ... } section { page-break-after: always } }in the global<style>it injects — already present. - For general pages: defaults to A4. To override, user can pass inline CSS
@page { size: letter }or similar. networkidle0waits for all network activity to stop — if artifact uses lazy images, bump timeout to 15000ms.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 HTML 到 PDF 的高质量矢量导出功能,适用于幻灯片和网页场景
- 明确区分普通页面与幻灯片的不同处理逻辑,实用性强
Highlights
- 触发描述清晰完整,参数格式明确,边界定义良好
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档结构良好但缺少 When to Use 使用场景说明章节
Recommendation: 建议补充 When to Use 章节,明确说明适用场景和使用时机
Highlights
- 文档结构清晰,包含 Preflight、Steps、Script template 等完整章节
- 提供了完整的端到端执行示例和脚本模板
Areas to improve
-
依赖安装失败处理建议不够具体 Reported severity: Minor
当 node_modules/puppeteer 不存在时,仅提示 /doctor 或 npm i,缺乏具体错误处理指导
Recommendation: 建议补充更具体的依赖安装失败处理建议,如提供完整的 npm install 命令示例
Highlights
- 工具来源明确(puppeteer),参数处理正确
- 覆盖了路径解析、依赖检查、输入验证等关键异常场景
- 输出结果包含文件大小和路径信息,便于用户确认
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 17
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.