Pdf Generator

Generate professional PDFs from Markdown, HTML, data, or code. Reports, invoices, contracts, and documents with best practices.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
6 · 4.2k · 65 current installs · 70 all-time installs
byIván@ivangdavila
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name, description, and the included files (tools.md, templates.md, advanced.md, SKILL.md) all focus on generating PDFs from Markdown/HTML/data. There are no unrelated environment variables, binaries, or config paths requested.
Instruction Scope
The SKILL.md explicitly states the skill will not execute code or make network requests; the repository is instruction-only and only provides code patterns. However, many examples perform local file I/O (reading/writing PDFs, loading images, merging files) and template rendering (e.g., HTML.format or f-strings). These are expected for the stated purpose but the examples do not include input sanitization; if you copy/run them you should validate/sanitize user-supplied data and confirm file paths.
Install Mechanism
No install spec or remote downloads are present (instruction-only). No archives or external install URLs to evaluate.
Credentials
No environment variables, credentials, or config path requirements are declared or used. The skill does not request unrelated secrets or access.
Persistence & Privilege
always is false and the skill is user-invocable only. There is no requested permanent presence or modification of other skills or system-wide settings.
Assessment
This skill is a documentation/reference pack (code examples only) and is internally coherent with its description: it asks for no credentials and contains no installs. Before using: (1) remember the examples perform local file I/O — review and run them only in directories you control; (2) sanitize any user-supplied data before embedding into HTML/templates to avoid injection issues; (3) if you install the recommended libraries (weasyprint, reportlab, pypdf, fpdf2, pandoc), install them from trusted package sources (official PyPI, distro packages) and check their docs for any optional network activity (fonts/assets); (4) don’t assume the skill’s text “never executes code” prevents you or another automated agent from copying and running the examples — always review generated code before executing. Overall the package is coherent and suitable as a local reference, but exercise normal caution when running example code or installing dependencies.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.1
Download zip
latestvk97cagav7r4r1pqvt5w9wx842h81fg2m

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

📄 Clawdis
OSLinux · macOS · Windows

SKILL.md

When to Use

User needs to create, generate, or export PDF documents. Agent handles document generation from multiple sources (Markdown, HTML, JSON, templates), formatting, styling, and batch processing.

Scope

This skill ONLY:

  • Provides code patterns and implementation guidance for PDF generation
  • Explains tool selection, CSS for print, and document structure
  • Shows reference examples for common document types

This skill NEVER:

  • Executes code or generates files directly
  • Makes network requests
  • Accesses files outside user's working directory

All code examples are reference patterns for the user to implement.

Quick Reference

TopicFile
Tool selectiontools.md
Document typestemplates.md
Advanced operationsadvanced.md

Core Rules

1. Choose the Right Tool

SourceBest ToolWhy
MarkdownpandocNative support, TOC, templates
HTML/CSSweasyprintBest CSS support, no LaTeX
Data/JSONreportlabProgrammatic, precise control
Simple textfpdf2Lightweight, fast

Default recommendation: weasyprint for most HTML-based documents.

2. Structure Before Style

# CORRECT: semantic structure
html = """
<article>
  <header><h1>Report Title</h1></header>
  <section>
    <h2>Summary</h2>
    <p>Content...</p>
  </section>
</article>
"""

# WRONG: style-first approach
html = "<div style='font-size:24px'>Report Title</div>"

3. Handle Page Breaks Explicitly

/* Force page break before */
.new-page { page-break-before: always; }

/* Keep together */
.keep-together { page-break-inside: avoid; }

/* Headers never orphaned */
h2, h3 { page-break-after: avoid; }

4. Always Set Metadata

# Example pattern for weasyprint
html = """
<html>
<head>
  <title>Document Title</title>
  <meta name="author" content="Author Name">
</head>
...
"""

5. Use Print-Optimized CSS

@media print {
  body {
    font-family: 'Georgia', serif;
    font-size: 11pt;
    line-height: 1.5;
  }
  
  @page {
    size: A4;
    margin: 2cm;
  }
  
  .no-print { display: none; }
}

6. Validate Output

After generating any PDF:

  1. Check file size (0 bytes = failed)
  2. Open and verify page count
  3. Verify fonts render correctly

Common Traps

TrapConsequenceFix
Missing fontsFallback to defaultsUse web-safe fonts
Absolute image pathsImages missingUse relative paths
No page sizeUnpredictable layoutSet @page { size: A4; }
Large imagesHuge filesCompress before use

Security & Privacy

This is a reference skill. It provides patterns and guidance only.

Data that stays local:

  • All PDF generation happens on user's machine
  • No data sent externally

This skill does NOT:

  • Execute code or make files
  • Make network requests
  • Access system files

Feedback

  • If useful: clawhub star pdf-generator
  • Stay updated: clawhub sync

Files

5 total
Select a file
Select a file to preview.

Comments

Loading comments…