원클릭으로
beautiful-pdfs
Build polished PDF documents by composing semantic HTML/CSS and rendering HTML to PDF.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Build polished PDF documents by composing semantic HTML/CSS and rendering HTML to PDF.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Inspect attached or local images and visually analyze PDFs with CPSL vision. Use for photos, screenshots, scans, charts, diagrams, OCR, handwriting, UI inspection, or any task that depends on pixels, layout, or other non-structural page content.
Use CPSL calendar and location modules for user-approved Apple Calendar events and current device location.
Use CPSL's native webbrowser module for web search, browsing, authenticated website interaction, forms, file uploads and downloads, screenshots, and user handoff.
Guide for the C -fbounds-safety language extension. Covers the language model, pointer annotations, adopting bounds-safety in existing C code, compiler build settings and modes, and runtime debugging of bounds violations.
Verify iOS app behavior on device or simulator via screenshots, UI hierarchy, and touch interactions.
Modernize test suites to use modern Swift Testing features or migrate from XCTest.
| name | beautiful-pdfs |
| description | Build polished PDF documents by composing semantic HTML/CSS and rendering HTML to PDF. |
| metadata | {"short-description":"Build polished PDFs with HTML and CSS"} |
Use this skill when the user asks for a PDF, printable report, invoice, brief, handout, form, one-pager, or visual document.
require; use fs.read, fs.write, and doc.renderFile./tmp and run:
fs.write("/tmp/pdf-smoke.html", "<!doctype html><meta charset=\"utf-8\"><h1>PDF smoke test</h1>")
doc.renderFile({source="/tmp/pdf-smoke.html", target="/tmp/pdf-smoke.pdf"})
print(fs.exists("/tmp/pdf-smoke.pdf"))
platform not supported, policy denial, or another capability error, stop PDF-generation work. Tell the user that PDF creation is unavailable in this session; do not try image-based PDF, font fetching, network downloads, package installs, browser printing, external renderers, or OS tools.help() and doc.help() if the exact API is not already visible in context.doc.renderFile({source="/tmp/report.html", target="/home/herm/report.pdf"}) for saved HTML-to-PDF output. It detects html -> pdf from the file extensions.Read and adapt the bundled print baseline when useful:
local css = fs.read("/skills/beautiful-pdfs/print.css")
Build source HTML in /tmp so the user only sees the PDF unless they ask for source files:
local css = fs.read("/skills/beautiful-pdfs/print.css")
local html = [[
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>]] .. css .. [[</style>
</head>
<body>
<main class="page">
<h1>Document Title</h1>
<p>Replace this with the user's content.</p>
</main>
</body>
</html>
]]
fs.write("/tmp/report.html", html)
Render the temporary HTML to the durable PDF path and verify that it exists:
doc.renderFile({source="/tmp/report.html", target="/home/herm/report.pdf"})
print(fs.exists("/home/herm/report.pdf"))
<!doctype html>, <meta charset="utf-8">, and a viewport meta tag.@page rules for size and margins. Use letter size unless the user asks for another page size..page for fixed page-sized sections, break-before: page for major section starts, and break-after: page for cover/title pages.break-inside: avoid only on content that must stay together, such as figures, callouts, short tables, signatures, and compact sections. Do not apply it to long sections or large tables that may need to span pages.When rendering succeeds, save the PDF under /home/herm unless the user requested another path. If the user asked only for a PDF, expose only the PDF in the final response; do not place or present source HTML next to it. Keep source files in /tmp or a hidden build directory unless the user asks for editable source files.
When rendering fails, do not claim a PDF was created. Preserve polished HTML only if useful, and say clearly that no PDF was produced in this session.