Pdf

From phuetz/code-buddy · View interactive version

Pdf is an AI agent skill from the GitHub repository phuetz/code-buddy. Work with PDF files: extract text, merge/split/reorder pages, rotate, read form fields, and render pages to images. To author a formatted PDF, build a .docx/.pptx and convert it. Use whenever the user asks to read, combine, split, or produce a PDF.

How to use this skill

Skill file

Work with PDF files (pypdf + pdf2image)

Use the open-source pypdf (import pypdf) for page operations and form fields,

and pdf2image (from pdf2image import convert_from_path) to render pages to

images. Work in visible steps; verify before reporting done.

Common tasks

Authoring a formatted PDF

pypdf does not lay out rich content. To produce a styled PDF, **build a .docx or

.pptx first** (see the docx/pptx skills), then convert:

soffice --headless --convert-to pdf --outdir . report.docx

This yields a clean, professionally formatted PDF.

Workflow

  1. Identify the operation (extract / merge / split / fill / convert).
  2. Run the pypdf (or soffice-convert) command via the bash tool.
  3. Verify: reopen the output (PdfReader(out).pages count, or extract a snippet) and print the path.
  4. Report the saved path + a one-line summary.
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.