Files
our-claude-skills/custom-skills/95-ourdigital-presales-seo/scripts/render_pdf.sh
Andrew Yim ba88247496 Implement ourdigital-presales-seo skill
SKILL.md orchestration (8 gated stages), references (rate_card.yaml,
findings_to_service rubric, competitor sets), findings.schema.json contract,
and scripts: kg_query.py (generalized KG examination), estimate.py
(findings→rate-card 견적 md/xlsx/json), build_deck.py (9-slide branded PPTX),
render_pdf.sh (Korean PDF via headless Chrome), plus client_brief.html template.

Validated on Sono Hotels & Resorts findings: estimate OD-2026-001
(23-47M KRW) and a 9-slide deck generated cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 23:10:53 +09:00

19 lines
894 B
Bash
Executable File

#!/usr/bin/env bash
# Render an HTML brief to PDF via headless Chrome (uses system fonts → Korean OK).
# Part of ourdigital-presales-seo (Stage 6).
# Usage: render_pdf.sh <input.html> [output.pdf]
set -euo pipefail
HTML="${1:?usage: render_pdf.sh <input.html> [output.pdf]}"
OUT="${2:-${HTML%.html}.pdf}"
CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
if [ ! -x "$CHROME" ]; then CHROME="/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"; fi
if [ ! -x "$CHROME" ]; then CHROME="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"; fi
if [ ! -x "$CHROME" ]; then echo "ERROR: no Chromium-based browser found for PDF rendering" >&2; exit 1; fi
DIR="$(cd "$(dirname "$HTML")" && pwd)"
BASE="$(basename "$HTML")"
"$CHROME" --headless --disable-gpu --no-pdf-header-footer \
--print-to-pdf="$OUT" "file://$DIR/$BASE" 2>/dev/null
echo "Wrote $OUT"