| 43-documents-branding |
01 |
api |
| playwright |
| pdf |
| pdf-renderer |
| archiver |
| puter-inference |
| typescript |
|
| phase |
provides |
| 41-diagrams-icons-theme-engine |
diagram-renderer.ts with resolveBrowserPath and Playwright launch pattern |
|
| phase |
provides |
| 42-wallpapers-social-format-conversion-voice |
content-job-runner.ts switch pattern and wallpaper-renderer.ts stripMarkdownFences pattern |
|
|
| pdf-renderer.ts — renderPdfDocument function using Playwright HTML-to-PDF for 4 docTypes |
| PdfDocumentBundle and BrandKitBundle types exported from types.ts |
| archiver package installed for ZIP operations (used by Plans 02-03) |
| content-job-runner dispatches "pdf-document" jobType to renderPdfDocument |
|
| 43-02 (brand-kit renderer will use BrandKitBundle type and archiver) |
| 43-03 (document UI panel will use PdfDocumentBundle type) |
|
| added |
patterns |
|
|
| buildPdfSystemPrompt function with docType switch for LLM prompt variation |
| stripMarkdownFences local helper (same pattern as wallpaper-renderer — not imported, duplicated intentionally) |
| try/finally browser lifecycle for Playwright cleanup |
|
|
| created |
modified |
| server/src/services/renderers/pdf-renderer.ts |
| server/src/__tests__/pdf-renderer.test.ts |
|
| server/src/services/renderers/types.ts |
| server/src/services/content-job-runner.ts |
| server/package.json |
|
|
| stripMarkdownFences duplicated locally in pdf-renderer — wallpaper-renderer does not export it and creating a shared util was not planned |
| buildPdfSystemPrompt uses a switch with 4 distinct system prompt variants (report/invoice/api-docs/one-pager) — each has structurally different instructions for the LLM |
| archiver installed now so Plans 02-03 can use it without an extra install step |
|
| PDF system prompts always include 'Use only inline CSS in a <style> block. No external URLs, no <link> tags, no <script> tags. Use web-safe system fonts' constraint |
| Playwright page.pdf() with format A4, printBackground true, 20mm margins — standard PDF output configuration |
|
|
5min |
2026-04-04 |