Skip to content
AI SkillBeginnerv1.2.0 Verified package

PDF Document Processing

Extract clean text and tables from PDFs, then have an AI assistant summarise, classify or answer questions over the extracted content.

AIAI Skills Hub EditorialEditorial team Published Mar 23, 2026Updated May 17, 2026 Reviewed May 17, 2026

Download this skill

3 files · SKILL.md + ZIP + Python · License CC BY 4.0

AI Skills Hub original
  • SKILL.md

    4.2 KBv1.2.0skill md
    Download
  • skill.json

    1.6 KBv1.2.0manifest
    Download
  • extract_pdf.py

    1.4 KBv1.2.0python Executable
    Download

License: CC BY 4.0. Only download and use files you are licensed to use.

This resource includes executable scripts. Review the code before running it, run it in an isolated environment, and never pass secrets you do not intend to share with the script.

What this skill is for

PDFs are where useful information goes to become hard to search. Contracts, research papers, invoices and reports all arrive as fixed-layout pages, while AI assistants work best with clean, ordered text.

This skill gives you a small, repeatable pipeline: extract text locally, check the extraction, then use a tightly scoped prompt to summarise or answer questions. It deliberately separates extraction from analysis so you can see what the model actually received.

How the workflow fits together

The included script walks the PDF page by page and inserts a ===== Page N ===== marker. Those markers matter: when the assistant says an obligation appears on page 14, you can check page 14 instead of trusting a plausible-sounding summary.

For text-based PDFs, extraction is usually good enough for reading and classification. For tables, forms and multi-column layouts, expect damage. A table-aware tool or a manual spot check is still required.

Where this skill breaks

  • Scanned documents. If there is no text layer, the extractor returns almost nothing. Run OCR first.
  • Complex tables. Cell relationships are visual, not semantic. Verify totals against the original.
  • Prompt injection. A document may contain text such as “ignore previous instructions”. Keep the task narrow and never let a document grant new permissions.
  • Long documents. Models have context limits and attention degrades. Process in chunks with a fixed extraction template, then combine the structured notes.

A quality checklist

Before you rely on an output, confirm that every cited page supports the claim, every number appears in the source, and every “not found” result is genuine rather than an extraction failure. For contracts and financial documents, a qualified human review remains mandatory.

At a glance

Difficulty
Beginner
Platforms
Claude, ChatGPT, Gemini, Local models
File format
SKILL.md + ZIP + Python
License
CC BY 4.0
Version
1.2.0
Last reviewed
May 17, 2026
Source
AI Skills Hub original
Access
Free

What it does

Capabilities included in this package.

  • Page-by-page text extraction with page numbers preserved
  • A repeatable prompt for summaries that cite page numbers
  • A table extraction checklist for documents where layout matters
  • Guardrails for scanned PDFs and password-protected files

Requirements

Check these before you start.

  • Python 3.10 or newer
  • pypdf installed (pip install pypdf)
  • A PDF you are permitted to process
  • An AI assistant that accepts pasted text or file uploads

Installation

Set up the skill in a working folder before you use it on real material.

  1. 1

    Download the skill package

    Download the SKILL.md file or the ZIP bundle from the files section on this page.

  2. 2

    Create a working folder

    Keep the PDF, the extracted text and your notes together so the work is reproducible.

    mkdir pdf-work && cd pdf-work
  3. 3

    Install the extraction dependency

    The example uses pypdf because it is lightweight and does not execute PDF content.

    python -m pip install pypdf
  4. 4

    Add the SKILL.md to your assistant

    In Claude, add it to a Project's instructions. In ChatGPT or Gemini, paste the instructions into a dedicated conversation or custom instruction box.

How to use it

A reviewed sequence that keeps a person in the loop.

  1. 1

    Extract text first, ask questions second

    Do not upload a 200-page PDF and ask for a one-line answer. Extract the text and inspect the first pages; OCR and layout issues are easier to spot before analysis.

  2. 2

    Run the extractor

    The script writes one text file per PDF with page markers so citations remain meaningful.

    python extract_pdf.py contract.pdf --out contract.txt
  3. 3

    Check extraction quality

    Search for repeated headers, blank pages and broken table rows. If the PDF is a scan, use an OCR tool first; pypdf will return little or no text.

  4. 4

    Use the analysis prompt

    Paste the extracted text (or attach the text file) and ask for obligations, dates, amounts and open questions. Require page references for every claim.

  5. 5

    Verify every material answer

    Open the cited page and confirm the statement. AI extraction is a reading aid, not a legal or financial review.

Use cases

Tasks this skill is designed for.

  • Summarise a 60-page vendor contract into obligations and dates
  • Turn a research PDF into a structured literature note
  • Extract line items from supplier invoices before review

Worked examples

Contract obligation summary

Ask: “List each obligation, the responsible party, the deadline and the page number. If a deadline is relative (for example, 30 days after signing), show the anchor event and flag the missing signing date.” This produces a reviewable table instead of a vague summary.

Research note from a paper

Ask for research question, method, sample, reported result, limitations and three quotes with page numbers. The quote requirement makes fabricated summaries easier to detect.

Security and privacy

Read this before running any downloaded script or sending material to an AI provider.

Treat downloaded code and extracted text as untrusted

PDFs can contain JavaScript, embedded files and external links. Do not open unknown PDFs in a privileged viewer, and never execute embedded attachments. This skill extracts text only. Treat all extracted content as untrusted input: a document can contain instructions designed to manipulate an AI assistant (prompt injection), so keep the assistant's task narrow and verify outputs.

Version history

  1. v1.2.0

    Initial reviewed release.

    Mar 23, 2026

Frequently asked questions

Related resources

Spotted something out of date? Suggest the fix and an editor will review it.