pdf-best-practices

Comprehensive guidelines for creating HTML that renders perfectly as PDF documents. Use when generating HTML for PDF conversion, handling page breaks, formatting tables for PDF, optimizing images for print, controlling content density, setting up colors and backgrounds for print, adding headers/footers/page numbers, or creating specific document types like invoices, reports, certificates, and letters. Also use when the user mentions 'HTML to PDF,' 'PDF generation,' 'print CSS,' 'page breaks,' 'PDF layout,' 'PDF tables,' 'PDF images,' 'content density,' 'print styles,' or 'pdfnoodle.'

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pdf-best-practices" with this command: npx skills add pdfnoodle/pdf-best-practices/pdfnoodle-pdf-best-practices-pdf-best-practices

PDF Best Practices Skill

Comprehensive guidelines for creating HTML that renders perfectly as PDF documents.

┌─────────────────────────────────────────────────────────────────────────────┐
│                         HTML to PDF Pipeline                                 │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│   ┌──────────┐    ┌──────────────┐    ┌─────────────┐    ┌──────────────┐  │
│   │  HTML    │───▶│  PDF Engine  │───▶│  Pagination │───▶│  Final PDF   │  │
│   │ Content  │    │  (Puppeteer) │    │  & Layout   │    │  Document    │  │
│   └──────────┘    └──────────────┘    └─────────────┘    └──────────────┘  │
│        │                                     │                              │
│        ▼                                     ▼                              │
│   ┌──────────┐                        ┌─────────────┐                       │
│   │  CSS     │                        │ Page Breaks │                       │
│   │  Styles  │                        │  & Margins  │                       │
│   └──────────┘                        └─────────────┘                       │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Quick Reference

I want to...Read this
Set up document structure correctlyDocument Setup
Control page breaksPage Breaks
Format tables for PDFTables
Handle images properlyImages
Optimize content densityContent Density
Set up colors and backgroundsColors & Backgrounds
Add headers, footers, page numbersHeaders & Footers
Create specific document typesDocument Types

Start Here

Building a new PDF document?

  1. Start with Document Setup for the HTML structure
  2. Review Page Breaks to prevent awkward splits
  3. Check Content Density to avoid sparse pages

Working with data tables?

  1. Read Tables for formatting and header repetition
  2. Apply Page Breaks to prevent row splitting

Document has images?

  1. Follow Images for sizing and positioning
  2. Use Page Breaks to keep images with captions

Creating a specific document type?

  1. Check Document Types for type-specific guidelines
  2. Available types: Invoice, Report, Certificate, Letter, Table-heavy, Image-heavy

Default Configuration

When generating PDFs, use these recommended parameters:

{
  "format": "A4",
  "margin": {
    "top": "40px",
    "right": "40px",
    "bottom": "40px",
    "left": "40px"
  },
  "printBackground": true
}

Quick Checklist

Before generating any PDF:

  • Complete HTML structure with DOCTYPE, html, head, body
  • CSS includes @page rule with A4 size
  • Body has -webkit-print-color-adjust: exact
  • All images have explicit width/height
  • Tables use thead/tbody structure
  • page-break-inside: avoid on logical content blocks
  • Headings have page-break-after: avoid
  • No excessive whitespace or sparse pages
  • Font sizes are 9pt or larger
  • Colors have sufficient contrast
  • pdfParams includes format, margins, and printBackground: true

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Maintenance

Maintenance makes home management simple. Record, search, and analyze your data with clear terminal output.

Registry SourceRecently Updated
General

ManualExpert

Professional translator for hardware and technical manuals delivering complete, page-by-page bilingual tables and Word exports for accurate DTP preparation.

Registry SourceRecently Updated
General

Semantic Router

让 AI 代理根据对话内容自动选择最合适的模型。四层识别(系统过滤→关键词→指示词→语义相似度),四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。支持 trigger_groups_all 非连续词组命中。

Registry SourceRecently Updated
General

Campaign

Campaign - command-line tool for everyday use

Registry SourceRecently Updated