pptx
Create and edit slide decks, generate slides from templates, and extract text.
ANanthropics/skills203k2,822 new stars in the last 7 days
Process PDF files - extract text, read content, create PDFs, merge or split documents. Use when user asks to read, create, or manipulate PDF files.
You now have expertise in PDF file processing. Follow these instructions based on the task.
# Install if needed
apt-get install -y poppler-utils
# Extract text from PDF
pdftotext input.pdf output.txt
# Extract specific pages
pdftotext -f 1 -l 5 input.pdf output.txt
# Extract with layout preservation
pdftotext -layout input.pdf output.txt
import fitz # PyMuPDF
# Open and read PDF
doc = fitz.open("input.pdf")
for page_num, page in enumerate(doc):
text = page.get_text()
print(f"--- Page {page_num + 1} ---")
print(text)
# Extract text from specific pages
page = doc[0] # First page (0-indexed)
text = page.get_text()
import pdfplumber
with pdfplumber.open("input.pdf") as pdf:
for page in pdf.pages:
# Extract text
text = page.extract_text()
print(text)
# Extract tables
tables = page.extract_tables()
for table in tables:
for row in table:
print(row)
from reportlab.lib.pagesizes import letter, A4
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
# Create a simple PDF
c = canvas.Canvas("output.pdf", pagesize=letter)
c.setFont("Helvetica", 12)
c.drawString(1*inch, 10*inch, "Hello World")
c.save()
# Install pandoc if needed
apt-get install -y pandoc texlive-xetex
# Convert Markdown to PDF
pandoc input.md -o output.pdf
# With custom template
pandoc input.md -o output.pdf --template=template.tex
from weasyprint import HTML
# From HTML string
html_content = "<h1>Hello World</h1><p>This is a PDF.</p>"
HTML(string=html_content).write_pdf("output.pdf")
# From HTML file
HTML("input.html").write_pdf("output.pdf")
import fitz
result = fitz.open()
for pdf_file in ["file1.pdf", "file2.pdf", "file3.pdf"]:
doc = fitz.open(pdf_file)
result.insert_pdf(doc)
result.save("merged.pdf")
import fitz
doc = fitz.open("input.pdf")
# Extract specific pages
output = fitz.open()
output.insert_pdf(doc, from_page=0, to_page=4) # Pages 1-5
output.save("pages_1_to_5.pdf")
# Split into individual pages
for i, page in enumerate(doc):
single_page = fitz.open()
single_page.insert_pdf(doc, from_page=i, to_page=i)
single_page.save(f"page_{i+1}.pdf")
import fitz
doc = fitz.open("input.pdf")
for page in doc:
# Add text watermark
page.insert_text(
(100, 100),
"CONFIDENTIAL",
fontsize=50,
color=(0.8, 0.8, 0.8),
rotate=45
)
doc.save("watermarked.pdf")
| Library | Use Case | Install |
|---|---|---|
| PyMuPDF (fitz) | Read, write, merge, split | pip install pymupdf |
| pdftotext | CLI text extraction | apt install poppler-utils |
| pdfplumber | Table extraction | pip install pdfplumber |
| reportlab | Create PDFs programmatically | pip install reportlab |
| weasyprint | HTML to PDF | pip install weasyprint |
| pdf2image | PDF to images | pip install pdf2image |
| PyPDF2 | Merge, split, rotate | pip install pypdf2 |
Create and edit slide decks, generate slides from templates, and extract text.
ANanthropics/skills203k2,822 new stars in the last 7 days
Create and edit Word docs with TOC, page numbers, headers and more.
ANanthropics/skills203k2,822 new stars in the last 7 days
Read and edit PDFs: extract text and tables, merge, split, rotate, and fill forms.
ANanthropics/skills203k2,822 new stars in the last 7 days
Co-write specs, proposals and decision docs through a structured, iterative workflow.
ANanthropics/skills203k2,822 new stars in the last 7 days
Read and edit spreadsheets: add columns, compute formulas, format, and clean messy data.
ANanthropics/skills203k2,822 new stars in the last 7 days
Create posters and visual art as PNG or PDF, guided by a design philosophy.
ANanthropics/skills203k2,822 new stars in the last 7 days