Overview
- Skill Key
- bartok9/pdf-generation
- Author
- bartok9
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/bartok9/pdf-generation
- Latest Commit SHA
- 65971d728ca990c11e56b419f96473572f051a82
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 Pdf Generation 技能。 若已安装,则直接安装 Pdf Generation 技能。
# PDF Generation Skill
**Purpose:** Generate professional PDFs from HTML/CSS without whitespace gaps or layout issues.
## The Problem
When generating PDFs from HTML, `page-break-inside: avoid` causes **orphan whitespace** — content that can't fit on the current page gets pushed entirely to the next page, leaving huge gaps.
## The Solution
### 1. Use Flow-Based Layout (NOT Fixed Page Containers)
**❌ WRONG:**
```html
<div class="page" style="min-height: 297mm;">
<!-- Content -->
</div>
```
**✅ RIGHT:**
```html
<body>
<!-- Content flows naturally -->
</body>
```
Use `@page` CSS rules instead of fixed page containers:
```css
@page {
size: A4;
margin: 18mm 15mm;
}
```
### 2. Protect ONLY Small Elements
Only use `break-inside: avoid` on elements that:
- Are **small** (cards, single rows, short boxes)
- Would look **broken** if split
**✅ Protect:**
- Individual table rows (`tr`)
- Cards (< 100px tall)
- Timeline items
- Step items
- Highlight boxes
**❌ Do NOT Protect:**
- Entire tables
- Large containers
- Entire sections
- Multi-column layouts
- Quote boxes at document end
### 3. Use Modern + Legacy Properties
```css
.small-element {
break-inside: avoid; /* Modern spec */
page-break-inside: avoid; /* Legacy support */
}
```
### 4. Keep Headers With Content
```css
h2, h3, h4, .section-header {
break-after: avoid;
page-break-after: avoid;
}
```
### 5. Prevent Orphan Lines
```css
body {
orphans: 3; /* Min lines at bottom of page */
widows: 3; /* Min lines at top of page */
}
```
### 6. Allow Tables to Break (But Keep Rows Together)
```css
table {
/* NO break-inside: avoid */
}
tr {
break-inside: avoid;
page-break-inside: avoid;
}
```
## Template
```css
@page {
size: A4;
margin: 18mm 15mm;
}
body {
font-size: 10pt;
line-height: 1.5;
orphans: 3;
widows: 3;
}
/* Headers stay with content */
h2, h3, h4 {
break-after: avoid;
page-break-after: avoid;
}
/* Small...
edholofy
University for AI agents. 92 courses, 4400+ scenarios, any model via OpenRouter. Auto-training loops generate per-model SKILL.md documents. Works with Claude Code, OpenClaw, Cursor, Windsurf. No fine-tuning required.
lethehades
macOS WPS Office workflow helper skill for safer document preparation, conversion, export, and compatibility guidance
capt-marbles
Web scraping and crawling with Firecrawl API. Fetch webpage content as markdown, take screenshots, extract structured data, search the web, and crawl documentation sites. Use when the user needs to scrape a URL, get current web info, capture a screenshot, extract specific data from pages, or crawl docs for a framework/library.
caqlayan
Tweet Processor Skill
carev01
Full-text search across structured Markdown documentation archives using SQLite FTS5. Use when you need to search large collections of Markdown articles that are separated by "---" delimiters and contain source URLs (marked with "*Source:" pattern). Provides fast BM25-ranked search with automatic source URL extraction for citations. Ideal for research, documentation lookups, and knowledge base exploration. Requires indexing documentation first with `docs.py index`.
camelsprout
DuckDB CLI specialist for SQL analysis, data processing and file conversion. Use for SQL queries, CSV/Parquet/JSON analysis, database queries, or data conversion. Triggers on "duckdb", "sql", "query", "data analysis", "parquet", "convert data".