html-to-pdf-slide-deck
Skill0 starsChanged 5 months agoMITView on GitHub
HTMLから16:9スライド型PDF(提案資料・ポートフォリオ・ピッチデック)を生成するとき。「PDFで提案資料」「スライドにして」「めくって見せる資料」等で発火。file://がPlaywright/Chromeでブロックされる罠の回避込み。
In this repository99 other files it gives its agents.
- agents-tools-quoted-jsonSkill
- asc-api-app-store-submitSkill
- asd-ste100Skill
- automation-bool-selector-pitfallsSkill
- automation-stale-cooldown-flagSkill
- autonomous-build-verifySkill
- book-to-skillSkill
- ccusage-cli-cost-trackingSkill
- chrome-ext-mv3-programmatic-injectSkill
- chrome-ext-store-assetsSkill
- claude-headless-p-invocationSkill
- claude-plugin-context-auditSkill
- claude-session-log-to-kbSkill
- cloudflare-workers-do-deploySkill
- codebase-to-courseSkill
- codesign-keychain-prompt-fixSkill
- codex-cli-setupSkill
- codex-delegation-handoffSkill
- content-factory-grounding-dedupSkill
- conversation-log-append-patternSkill
- cron-to-launchd-macosSkill
- cross-automation-shared-resource-killSkill
- design-token-migration-rnSkill
- discord-bot-image-to-claudeSkill
- discord-gateway-resume-dedupSkill
- excel-filtered-url-http-auditSkill
- execution-budget-vs-capsSkill
- expo-free-local-ios-testflightSkill
- ga4-connect-projectsSkill
- gcal-oauth-desktop-setupSkill
- git-commit-helperSkill
- git-prepush-secret-remote-checkSkill
- gsc-cli-automationSkill
- hatena-blogsync-autopostSkill
- hook-latency-wrapSkill
- hook-log-append-patternSkill
- humanizerSkill
- human-review-gate-shellSkill
- implementation-model-routingSkill
- insights-to-claude-mdSkill
- ios-permission-key-security-matrixSkill
- ios-sim-store-screenshotsSkill
- launchd-exit78-exconfig-debugSkill
- llm-content-pipeline-quality-gateSkill
- local-ai-video-pipelineSkill
- local-flux-mflux-image-genSkill
- local-llm-slow-diagnosisSkill
- local-music-generationSkill
- lottie-skottie-authoring-pitfallsSkill
- machine-wide-api-ratelimit-latchSkill
- macos-hook-path-timeoutSkill
- md-to-docx-reportSkill
- memory-md-inject-bloat-auditSkill
- message-display-secrets-maskSkill
- metric-source-attributionSkill
- migrate-icloud-desktop-assetsSkill
- nextauth-local-e2e-sessionSkill
- nextjs-rsc-payload-slimSkill
- nothing-designSkill
- openclaw-ollama-setupSkill
- The first 60 shown.
The file
Files
Procedure
- スライドHTMLを書く(1ファイル完結)。各スライド=1ページ:
@media print { @page { size: 1280px 720px; margin: 0; } /* 96dpiで16:9。px指定が効く */ html, body { background: #fff; } .slide { margin: 0; page-break-after: always; } .slide:last-child { page-break-after: auto; } } .slide { width: 1280px; height: 720px; padding: 70px 88px; overflow: hidden; display: flex; flex-direction: column; } @media screen { .slide { margin: 24px auto; box-shadow: 0 20px 60px -20px rgba(0,0,0,.6); } } - ローカルサーバで配信(
file://はPlaywright/Chrome headlessでブロックされる):cd <dir> && (python3 -m http.server 8777 >/dev/null 2>&1 &) ; sleep 1 curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8777/deck.html # 200を確認 - headless ChromeでPDF化:
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" "$CHROME" --headless=new --disable-gpu --no-pdf-header-footer \ --print-to-pdf="出力.pdf" "http://127.0.0.1:8777/deck.html" - 必ず自己検証:
ReadツールでPDFをpages:"1-8"指定して全ページ目視。はみ出し・見切れ・フッター被りを確認。 - 終わったら
pkill -f "http.server 8777"でサーバ停止。
Pitfalls
box-shadowは使うな(2026-07-03実害):スライド内要素の影はPDF化するとPreview.appで濁ったグレー矩形として描画される(特にダーク画像直下の濃い影)。ユーザーに「グレーの背景が醜い」と指摘された。装飾はborder-radius・罫線・余白で。- 実物スクショに
object-fit: coverを使うな(同日実害):固定高さ+coverは左右を無断トリミングし文字が見切れる。実物証拠系の画像はwidth:100%; height:autoの原寸比率で全体表示。行の高さ揃えは.card { display:grid; grid-template-rows: <画像行の固定高> auto }で行い、画像中心を揃えたい時はalign-self:center。 - スクショの黒余白はPILのautocropで落とす:
im.convert("L").point(v>30).getbbox()+pad≈34px。角丸はCSSborder-radius+overflow:hiddenで足りる(画像加工不要)。 file://の可否は経路次第:Playwright MCPはAccess to "file:" protocol is blocked。Chrome headless直呼びは--virtual-time-budget=8000を付ければfile://でもWebフォント込みで安定した(2026-07-03実績)。不安定ならhttp配信にフォールバック。- 縦オーバーフローが最大の敵:
.slideはoverflow:hiddenなので超過分は無音で見切れる。グリッドが縦に伸びる系(カード2段・統計4枚)は要注意。実レンダリングで毎回確認。統計は横1列、説明文は短く。 --no-pdf-header-footer必須:付けないと日付・URLが各ページに焼き込まれる。- フォント:Google Fonts(明朝=Shippori Mincho+ゴシック=Zen Kaku Gothic New 等)はネット接続時のみ。オフライン提示があるならローカル埋め込みを検討。
- スクショ検証時のreveal罠:IntersectionObserverの
opacity:0初期値はhtml.jsでゲートし、JS無効/印刷時は表示させる(でないとPDF/フルページスクショで内容が消える)。
Verification
pdftoppm -png -r 100 deck.pdf preview/pでPNG化→Readで全ページ目視が軽くて確実。(1)見切れゼロ (2)フッターと本文が被らない (3)数字・固有名詞が実データ通り (4)影・グレー矩形なし、を確認してから完了宣言する。- デザインは全ページ同一トーンを維持(1ページだけ背景色を変えるとユーザーNG実績あり)。変えるのは表紙・裏表紙だけ。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

