Skip to content
Back to skills

Pdf Toolkit

ASecurity

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms.

  • 7 stars
  • 0 votes
  • 1 copy
  • 7 views
  • Added September 3, 2026
businesspythonaws

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add mediar-ai/skillhubz --skill pdf-toolkit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdf Toolkit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pdf Toolkit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mediar-ai-pdf-toolkit/badge)](https://www.skillsdirectory.com/skills/mediar-ai-pdf-toolkit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# PDF Toolkit

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms.

## Prerequisites

- Python 3.8+
- Libraries: pypdf, pdfplumber, reportlab
- Optional: pytesseract (for OCR), pdf2image, poppler-utils

## Instructions

1. **Read and extract text from PDFs**
   ```python
   from pypdf import PdfReader
   reader = PdfReader("document.pdf")
   text = ""
   for page in reader.pages:
       text += page.extract_text()
   ```

2. **Merge multiple PDFs**
   ```python
   from pypdf import PdfWriter, PdfReader
   writer = PdfWriter()
   for pdf_file in ["doc1.pdf", "doc2.pdf"]:
       reader = PdfReader(pdf_file)
       for page in reader.pages:
           writer.add_page(page)
   with open("merged.pdf", "wb") as output:
       writer.write(output)
   ```

3. **Split PDF into individual pages**
   ```python
   reader = PdfReader("input.pdf")
   for i, page in enumerate(reader.pages):
       writer = PdfWriter()
       writer.add_page(page)
       with open(f"page_{i+1}.pdf", "wb") as output:
           writer.write(output)
   ```

4. **Extract tables with pdfplumber**
   ```python
   import pdfplumber
   with pdfplumber.open("document.pdf") as pdf:
       for page in pdf.pages:
           tables = page.extract_tables()
           for table in tables:
               for row in table:
                   print(row)
   ```

5. **Create new PDFs with reportlab**
   ```python
   from reportlab.lib.pagesizes import letter
   from reportlab.pdfgen import canvas
   c = canvas.Canvas("new.pdf", pagesize=letter)
   c.drawString(100, 750, "Hello World!")
   c.save()
   ```

6. **OCR scanned PDFs**
   ```python
   import pytesseract
   from pdf2image import convert_from_path
   images = convert_from_path('scanned.pdf')
   for image in images:
       text = pytesseract.image_to_string(image)
   ```

## Error Handling

- If PDF is password-protected, use `PdfReader("file.pdf", password="pass")`
- If text extraction fails, try pdfplumber or OCR approach
- For corrupted PDFs, use qpdf to attempt repair

## Notes

- Use pypdf for basic operations (merge, split, rotate)
- Use pdfplumber for text/table extraction with layout
- Use reportlab for creating new PDFs programmatically
- Command-line tools: pdftotext, qpdf, pdftk for batch operations

Source: anthropics/skills

Files in this skill

  • manifest.json346 B
  • skill.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in business →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.