Pdf Generation
Skill by bartok9
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bartok9/pdf-generationWhat This Skill Does
The Pdf Generation skill, developed by bartok9, provides a systematic framework for creating professional-grade PDFs from HTML/CSS inputs within the OpenClaw environment. It solves the common 'orphan whitespace' problem encountered when standard layout engines force page breaks within large, non-divisible blocks. By shifting from fixed-height page containers to a flow-based layout model and leveraging precise CSS break controls, this skill ensures documents maintain structural integrity, professional typography, and optimal page utilization.
Installation
To integrate this functionality into your OpenClaw environment, execute the following command in your terminal:
clawhub install openclaw/skills/skills/bartok9/pdf-generation
Ensure you have the necessary rendering engines installed on your host system. For optimal results, WeasyPrint is recommended due to its superior CSS support. You can install it via pip install weasyprint or your system package manager.
Use Cases
This skill is ideal for generating clean, automated business documentation. Typical use cases include:
- Converting internal reports and data summaries into polished A4 documents.
- Generating invoices where table rows must not be split across page boundaries.
- Creating technical manuals where headers must remain attached to their descriptive content.
- Producing curriculum or timeline-based materials that require distinct visual 'cards' to remain intact.
Example Prompts
- "Generate a PDF report from the monthly_stats.html file using the PDF Generation skill; ensure the table rows don't break across pages."
- "I need to export the latest project documentation to PDF. Use the provided CSS template to make sure my step-by-step instructions stay together and headers don't dangle at the bottom of pages."
- "Convert my data summary dashboard into a print-ready PDF using WeasyPrint, applying the recommended break-inside avoidance for my summary cards."
Tips & Limitations
- Avoid Fixed Containers: Never use fixed-height divs (e.g., min-height: 297mm) as they interfere with the natural flow of PDF rendering.
- Selectivity is Key: Use
break-inside: avoidsparingly. Applying it to large containers will actually create more whitespace issues; reserve it for small, cohesive blocks like table rows, cards, or specific highlight boxes. - Print Media Queries: Always wrap print-specific color adjustments in
@media printto ensure exact color rendering. - CSS Hierarchy: Remember that legacy properties like
page-break-insideare still required for cross-tool compatibility alongside modernbreak-insideproperties.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bartok9-pdf-generation": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read, code-execution