PDF Generation Skill for Openclaw

A comprehensive guide and skill set for generating professional-grade PDFs from HTML and CSS by mastering flow-based layouts and print-specific CSS rules.

bartok9
v1.0.0
Mar 6, 2026
3
1.3k
47

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install pdf-generation

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install pdf-generation using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is PDF Generation Skill?

This skill provides a technical framework for converting web content into high-quality PDF documents while avoiding common pitfalls like orphan whitespace and awkward page breaks. By utilizing modern Openclaw Skills techniques, developers can move away from rigid page containers and embrace fluid, print-optimized CSS that ensures content flows naturally across pages. It focuses on the precise application of page-break properties and paged media rules to create documents that look professional regardless of length or complexity.

The primary philosophy involves using flow-based layouts instead of fixed containers, ensuring that content adapts to the page size dynamically. This approach is essential for any Openclaw Skills implementation requiring automated document generation, from invoices to complex technical reports.

PDF Generation Skill Use Cases

  • Generating dynamic invoices or reports from web-based data sources.
  • Creating print-ready documentation from Markdown or HTML templates.
  • Automating the production of professional ebooks or whitepapers.
  • Developing automated PDF export features for web applications using Openclaw Skills.

How PDF Generation Skill Works

  1. Define the document structure using semantic HTML rather than fixed-height containers to allow for natural text flow.
  2. Apply @page CSS rules to manage margins and paper sizes like A4 or Letter.
  3. Implement flow-control properties such as break-inside: avoid specifically for small elements like cards, highlight boxes, or table rows.
  4. Configure orphan and widow settings to ensure a minimum of three lines at the start and end of every page transition.
  5. Utilize specialized rendering tools to process the HTML/CSS into the final PDF format, verifying the output against a pre-flight checklist.

PDF Generation Skill Setup

To begin using this PDF generation approach within Openclaw Skills, you must install the necessary rendering tools. For the recommended engine, WeasyPrint, use the following commands:

# Install WeasyPrint via Homebrew (macOS)
brew install weasyprint

# Or install via pip
pip install weasyprint

Once installed, you can generate a PDF with a simple command-line execution:

weasyprint input.html output.pdf

PDF Generation Skill Data Schema & Taxonomy

The skill organizes data through standard CSS paged media rules and HTML structures to ensure layout consistency. The following table describes how elements are handled within Openclaw Skills:

Element CSS Property Logical Purpose
Global Document @page Defines page size, orientation, and margins.
Typography orphans & widows Controls the minimum number of lines at the top or bottom of pages.
Small Components break-inside: avoid Prevents splitting cards, rows, or timeline items across pages.
Headers break-after: avoid Ensures headers stay attached to the content that follows them.
Tables tr { break-inside: avoid } Allows tables to span multiple pages while keeping individual rows intact.

PDF Generation Skill Advanced Features

  • Support for multi-column layouts with controlled content flow.
  • Cross-engine compatibility using both modern and legacy CSS page-break properties.
  • Integration with JavaScript-rendered content via Puppeteer for complex Openclaw Skills workflows.
  • Precision control over print color adjustment for exact branding reproduction via exact color-adjust settings.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*