Pdf documents

From Private-Garden-Labs/garden-desk · View interactive version

Pdf documents is an AI agent skill from the GitHub repository Private-Garden-Labs/garden-desk. Create PDFs or change pages. Use read for PDF text.

How to use this skill

Skill file

Use ReportLab Platypus for text PDFs. Adapt this recipe; let paragraphs flow across pages.

from xml.sax.saxutils import escape
from reportlab.lib.styles import ParagraphStyle
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.platypus import Paragraph, SimpleDocTemplate

pdfmetrics.registerFont(TTFont("Body", "/usr/share/fonts/dejavu/DejaVuSerif.ttf"))
title = ParagraphStyle("title", fontName="Body", fontSize=22, leading=28, spaceAfter=16)
body = ParagraphStyle("body", fontName="Body", fontSize=12, leading=18, spaceAfter=10)
paragraphs = ["Body text."]
path = "/workspace/result.pdf"
story = [Paragraph(escape("Title"), title)]
story += [Paragraph(escape(text), body) for text in paragraphs]
SimpleDocTemplate(path, title="Title").build(story)

Reopen with PdfReader(path); compare page count and page.extract_text() with the request. Return after a successful check. Never decode PDF streams manually.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.