Gen Pdf logo

Gen Pdf

Community
antoniolg
gen-pdf

Converts a Markdown file to a styled PDF with DevExpert branding (logo in bottom-right corner). Use when asked to generate a PDF from a Markdown document, or when any DevExpert proposal/document needs to be exported as PDF.

Overview

Publisherantoniolg
Repositoryagent-kit
Skill namegen-pdf
Stars
97
Forks
16
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by antoniolg on GitHub. Read the source before you install it.

Installation

Install the Gen Pdf AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/antoniolg/agent-kit.git /tmp/agent-kit
mkdir -p .claude/skills
cp -r /tmp/agent-kit/skills/gen-pdf .claude/skills/gen-pdf
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gen Pdf in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gen Pdf on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gen Pdf is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

gen-pdf — Generador de PDFs con estilo Obsidian + DevExpert

Convierte cualquier fichero Markdown a PDF con un acabado visual cercano al export de Obsidian (tipografía y jerarquía neutras) y mantiene el logo de DevExpert en la esquina inferior derecha.

Cuándo usar esta skill

  • El usuario pide generar un PDF a partir de un fichero .md
  • Se acaba de crear o actualizar un documento/propuesta y hay que exportarlo
  • El usuario pide añadir el logo de DevExpert a un PDF existente

Dependencias

bash
pip install markdown-it-py[plugins] weasyprint reportlab PyPDF2

Rutas clave

  • Logo DevExpert: assets/devexpert-logo.png (logo horizontal completo, relativo a la carpeta de la skill)
  • Output por defecto: ~/Documents/aipal/40-archive/

Script de generación

Usa el siguiente script Python. Acepta input_md y output_pdf como variables:

python
import os
import tempfile
from pathlib import Path

from markdown_it import MarkdownIt
from PyPDF2 import PdfReader, PdfWriter
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen import canvas
from weasyprint import CSS, HTML

md = MarkdownIt("commonmark", {"breaks": True, "html": True}).enable("table")

CSS_STYLES = """
@page {
  size: A4;
  margin: 30mm 24mm 26mm 24mm;
}

html, body {
  margin: 0;
  padding: 0;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  font-size: 12pt;
  line-height: 1.46;
}

p {
  margin: 0 0 0.82em 0;
}

h1, h2, h3, h4 {
  color: #111111;
  font-weight: 800;
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: 24pt;
  margin-bottom: 0.9em;
}

h2 {
  font-size: 20pt;
  margin-top: 1.1em;
  margin-bottom: 0.74em;
}

h3 {
  font-size: 16pt;
  margin-top: 0.95em;
  margin-bottom: 0.58em;
}

h4 {
  font-size: 13pt;
  margin-top: 0.8em;
  margin-bottom: 0.4em;
}

strong {
  color: #111111;
  font-weight: 800;
}

ul, ol {
  margin: 0.35em 0 0.9em 1.28em;
  padding: 0;
}

li {
  margin-bottom: 0.24em;
}

li::marker {
  color: #a0a0a0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9em 0 1.1em 0;
  font-size: 10.5pt;
}

th, td {
  border: 1px solid #d4d4d4;
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f3f3f3;
  color: #111111;
  font-weight: 700;
}

tr:nth-child(even) td {
  background: #fafafa;
}

blockquote {
  border-left: 3px solid #d0d0d0;
  padding-left: 12px;
  color: #303030;
  margin: 0.8em 0;
}

code {
  font-family: "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background: #f5f5f5;
  padding: 0.08em 0.28em;
  border-radius: 4px;
}

pre code {
  display: block;
  white-space: pre-wrap;
  padding: 0.8em;
}

a {
  color: #111111;
  text-decoration: underline;
  text-decoration-color: #c1c1c1;
}

hr {
  border: 0;
  height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  page-break-after: always;
  break-after: page;
}
"""


def resolve_logo_path(explicit_logo_path=None):
    if explicit_logo_path:
        explicit_path = Path(explicit_logo_path).expanduser()
        if explicit_path.exists():
            return explicit_path

    candidates = []
    env_logo = os.getenv("GEN_PDF_LOGO_PATH")
    if env_logo:
        candidates.append(Path(env_logo).expanduser())

    skill_dir = os.getenv("GEN_PDF_SKILL_DIR")
    if skill_dir:
        candidates.append(Path(skill_dir).expanduser() / "assets" / "devexpert-logo.png")

    candidates.extend(
        [
            Path.cwd() / "assets" / "devexpert-logo.png",
            Path.home() / ".claude" / "skills" / "gen-pdf" / "assets" / "devexpert-logo.png",
        ]
    )

    for candidate in candidates:
        if candidate.exists():
            return candidate

    return None


def gen_pdf(input_md, output_pdf, add_logo=True, logo_path=None):
    input_md_path = Path(input_md).expanduser()
    output_pdf_path = Path(output_pdf).expanduser()
    output_pdf_path.parent.mkdir(parents=True, exist_ok=True)

    content = input_md_path.read_text(encoding="utf-8")
    html_content = md.render(content)
    full_html = f"""<!doctype html>
<html>
  <head><meta charset="utf-8" /></head>
  <body>{html_content}</body>
</html>"""

    HTML(string=full_html, base_url=str(input_md_path.parent)).write_pdf(
        str(output_pdf_path), stylesheets=[CSS(string=CSS_STYLES)]
    )

    if not add_logo:
        return

    resolved_logo = resolve_logo_path(logo_path)
    if not resolved_logo:
        return

    reader = PdfReader(str(output_pdf_path))
    writer = PdfWriter()

    with tempfile.NamedTemporaryFile(suffix=".pdf", delete=False) as temp_file:
        temp_logo_pdf = temp_file.name

    page_width, _ = A4
    canvas_obj = canvas.Canvas(temp_logo_pdf, pagesize=A4)
    canvas_obj.drawImage(
        str(resolved_logo),
        page_width - 128,
        14,
        width=110,
        height=27,
        mask="auto",
        preserveAspectRatio=True,
    )
    canvas_obj.showPage()
    canvas_obj.save()

    logo_overlay_page = PdfReader(temp_logo_pdf).pages[0]
    for page in reader.pages:
        page.merge_page(logo_overlay_page)
        writer.add_page(page)

    with output_pdf_path.open("wb") as output_file:
        writer.write(output_file)

    os.unlink(temp_logo_pdf)

Instrucciones de uso

  1. Importa o copia la función gen_pdf en un script temporal en /tmp/
  2. Llámala con input_md = ruta al fichero Markdown y output_pdf = ruta de salida
  3. Mantén add_logo=True para documentos DevExpert
  4. Si ejecutas fuera de la carpeta de la skill, define GEN_PDF_SKILL_DIR o GEN_PDF_LOGO_PATH
  5. Tras generar, copia al directorio temporal de Telegram ($TMPDIR/aipal/documents/) y responde con [[document:/ruta]]

Notas

  • Los --- en el Markdown fuerzan salto de página en el PDF
  • Los saltos de línea simples se respetan (breaks=True)
  • Las tablas Markdown se renderizan con estilo neutro
  • Las imágenes referenciadas en el Markdown se resuelven con base_url del fichero de entrada
  • Para propuestas DevExpert, usa siempre el logo horizontal completo incluido en assets/devexpert-logo.png, no el icono cuadrado.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Gen Pdf AI skill do?

Converts a Markdown file to a styled PDF with DevExpert branding (logo in bottom-right corner). Use when asked to generate a PDF from a Markdown document, or when any DevExpert proposal/document needs to be exported as PDF.

Why use Gen Pdf on TypingMind?

Because you install it once and use it with any model. Gen Pdf is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gen Pdf in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/antoniolg/agent-kit/tree/main/skills/gen-pdf. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Gen Pdf?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gen Pdf?

As many as you like. As long as a model supports skills, you can use Gen Pdf with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gen Pdf AI skill free?

It is published on GitHub by antoniolg. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇