Skip to content
Skills Library
Documents & office · Conversion & formats

pdf

/pdf

Generate, inspect, assemble, and render vector-quality PDF documents with precise page geometry, print typography, page breaks, and PDF/A standards. Use when generating downloadable reports, invoices, printable whitepapers, combining PDF pages, or rendering HTML to vector PDF.

Repository
wrongstack ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Generate, inspect, assemble, and render vector-quality PDF documents with precise page geometry, print typography, page breaks, and PDF/A standards. Use when generating downloadable reports, invoices, printable whitepapers, combining PDF pages, or rendering HTML to vector PDF.

Original author description

Generate, inspect, assemble, and render vector-quality PDF documents with precise page geometry, print typography, page breaks, and PDF/A standards. Use when generating downloadable reports, invoices, printable whitepapers, combining PDF pages, or rendering HTML to vector PDF.

How it works

  1. Selection card
  2. Overview
  3. Core Engineering Rules
  4. Implementation Pattern (Headless Chromium Print)
  5. Skills in scope
  6. Acceptance checks
Original SKILL.md headings · 87 lines, 599 words
SKILL.md preview
---
name: pdf
description: "Generate, inspect, assemble, and render vector-quality PDF documents with precise page geometry, print typography, page breaks, and PDF/A standards. Use when generating downloadable reports, invoices, printable whitepapers, combining PDF pages, or rendering HTML to vector PDF."
version: 1.1.0
required-capabilities: [filesystem.read, filesystem.write]
required-tools: []
optional-capabilities: [verification.run, web.research]
trigger: "generating downloadable reports, invoices, printable whitepapers, combining PDF pages, or rendering HTML to vector PDF."
metadata:
  routing-group: media
---

# PDF Document Engineering — WrongStack

## Selection card
- Task: Generate, manipulate, and inspect print-ready vector PDF documents.
- Start: Define target page size (A4, Letter), bleed, margin boundaries, and color space.
- Finish: apply the acceptance checks below; report observed results and unresolved constraints.

## Overview

PDF is a fixed-layout vector format designed for visual fidelity across all printing and viewing devices.
Avoid blurry rasterized screenshots disguised as PDFs. Use native vector PDF composition tools
such as `pdf-lib` (npm), Typst, or headless Chromium print engines (`@playwright/test` / Puppeteer; checked 2026-10-23: pdf-lib 1.17.1, Playwright 1.64.1, Puppeteer 25.16.0)
with explicit print CSS (`@media print`, `@page`) to achieve flawless typography, pagination, and vector line art.

## Core Engineering Rules

1. **Explicit Page & Margin Geometry**:
   - Always declare `@page` dimensions explicitly: `size: A4 portrait; margin: 20mm 15mm 20mm 15mm;`.
   - Prevent ugly page cuts across table rows or headers using `page-break-inside: avoid;` and `break-inside: avoid;`.
   - Force orphan heading protection: `h1, h2, h3 { break-after: avoid; page-break-after: avoid; }`.
2. **Vector Graphics & Font Embedding**:
   - Keep logos, diagrams, and line dividers as pure SVG or PDF vector paths; never compress to lossy JPEGs.
   - Ensure all web fonts are embedded or local system fonts to avoid fallback to generic Courier/Times.
3. **Running Headers & Footers**:
   - For Chromium PDF generation, use `displayHeaderFooter: true` with standard footer templates: `<div style="font-size: 9px; text-align: right; width: 100%; padding-right: 15mm;"><span class="pageNumber"></span> / <span class="totalPages"></span></div>`.
4. **Color & Print Contrast**:
   - Enable `printBackground: true` in the browser renderer so background cards and table fills render faithfully.
   - Maintain pure `#000000` or `#111827` for body copy; avoid pale grey text that washes out on office printers.

## Implementation Pattern (Headless Chromium Print)

```typescript
import { chromium } from 'playwright';
import * as fs from 'fs/promises';

const browser = await chromium.launch({ headless: true });
const page = await browser.newPage();

await page.setContent(`
  <!DOCTYPE html>
  <html>
  <head>
    <style>
      @page { size: A4 portrait; margin: 25mm 20mm 25mm 20mm; }
      body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1e293b; line-height: 1.5; }
      h1 { color: #0f172a; font-size: 24pt; margin-bottom: 8pt; break-after: avoid; }
      .meta { font-size: 10pt; color: #64748b; margin-bottom: 24pt; border-bottom: 1pt solid #e2e8f0; padding-bottom: 12pt; }
      table { width: 100%; border-collapse: collapse; margin-top: 16pt; break-inside: auto; }
      tr { break-inside: avoid; }
      th, td { border: 0.5pt solid #cbd5e1; padding: 6pt 10pt; font-size: 9.5pt; text-align: left; }
      th { background-color: #f1f5f9; font-weight: 600; }
    </style>
  </head>
  <body>
    <h1>System Audit & Compliance Report</h1>
    <div class="meta">Generated: 2026-10-23 | Environment: Production Edge</div>
    <p>Detailed verification of global edge gateway policies and TLS termination certificates.</p>
  </body>
  </html>
`, { waitUntil: 'networkidle' });

await page.pdf({
  path: 'compliance_report.pdf',
  format: 'A4',
  printBackground: true,
  displayHeaderFooter: true,
  footerTemplate: '<div style="font-size: 8pt; color: #94a3b8; width: 100%; text-align: right; padding-right: 20mm;"><span class="pageNumber"></span> of <span class="totalPages"></span></div>',
  margin: { top: '25mm', bottom: '25mm', left: '20mm', right: '20mm' }
});

await browser.close();
```

## Skills in scope

- `office-documents` — multi-format document generation across DOCX, XLSX, PPTX, and PDF
- `canvas-design` — poster-grade editorial layouts, grids, and print typography
- `docx` — editable Word document authoring when downstream redlining is required

## Acceptance checks

- [ ] Document renders with crisp vector text and scalable SVG/PDF paths without raster blurriness.
- [ ] Page geometry (`@page` A4/Letter, bleed, margins) and running headers/footers ("Page X of Y") render without overlaps.
- [ ] Table rows (`tr { break-inside: avoid; }`) and section headings (`break-after: avoid;`) do not split awkwardly across page boundaries.
- [ ] Background fills, cards, and semantic colors are preserved via `printBackground: true` and verified for print contrast.

Versions

RepositoryScoreLicence
This page · wrongstack/wrongstack100MIT
chris-peterson/fathom100MIT
shunwuyu/ai_lesson100MIT
rongxinzy/rongxinai100AGPL-3.0
mateaix/mateclaw100Apache-2.0
Navinspire-ia/navin100AGPL-3.0
ai-workspace-lab/xworkspace-core-skills100MIT
astrbotdevs/astrbot100AGPL-3.0
openbmb/pilotdeck100AGPL-3.0

Database snapshot: 13.11.2026 · package version f7bc64f9958c (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100pdf-official
    Generating PDFs with pdfkit or puppeteer in Node.js. Use when generating PDF reports, invoices, certificates, or any printable document from data or HTML templates.
  • 100course-to-pdf
    Bind a static HTML course or documentation site into one textbook-typeset PDF, retypesetting the screen CSS for print. Use whenever someone wants a course, handbook, lesson notes, or docs site as a single printable PDF or book, or asks why an HTML-to-PDF export came out…
  • 100pdf-documents
    Makes PDFs with the PDFDispatch MCP tools (render_template, html_to_pdf, markdown_to_pdf, url_to_pdf, office_to_pdf, merge_pdfs, screenshot, upload_file). Use when the user asks for a PDF, an invoice, report, certificate or other printable document, to convert Word, Excel or…
  • 100shotlane
    Screenshot any public web page, read pages as clean Markdown (JavaScript rendered), and render HTML or URLs to PDF using the Shotlane API. Use when the user wants to see what a website looks like, check a deployed page or layout on desktop/mobile, capture a page or element as an…
  • 100hk-pdf-export
    Turn an HTML page, or content that has to become one first, into a PDF in the house design and check nothing was lost. Triggers on: 'make a PDF of this', 'export this to PDF', 'can I print this', or /hk-pdf-export.
  • 100report-generator
    Generate PDF/HTML reports from templates and data. Use when: creating client reports; generating weekly summaries; producing marketing performance reports; automating recurring reports

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.