pdf

Extract text and tables from PDF documents using Python libraries.

2|Updated Nov 5, 2018
One-click install
npx skills add https://github.com/gyuha/blog --skill pdf-gyuha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/gyuha/blog/tree/main/.agents/skills/pdf
Command: npx skills add https://github.com/gyuha/blog --skill pdf-gyuha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, reportlab, pytesseract, pdf2image, poppler-utils, qpdf, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of interacting with PDF files, from simple text extraction to complex form filling and data manipulation, saving significant manual effort.

Core Features & Use Cases

  • Form Filling: Fill out both fillable and non-fillable PDF forms accurately.
  • Data Extraction: Extract text, tables, and metadata from PDFs.
  • PDF Manipulation: Merge, split, rotate, and encrypt/decrypt PDF documents.
  • OCR: Perform Optical Character Recognition on scanned PDFs to make them searchable.
  • Use Case: Automatically fill out a batch of standardized application forms with user-provided data, or extract all tables from a research paper into a structured format.

Quick Start

Use the pdf skill to extract all text from the attached file 'report.pdf'.

Frequently Asked Questions about pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract text and tables from a PDF document in Python?

To extract text and tables from a PDF, use pdfplumber and pypdf. pdfplumber pulls structured table data, while pypdf reads standard text and metadata, enabling comprehensive data extraction from research papers and reports.

Can I fill out both fillable and non-fillable PDF forms automatically?

You can fill both fillable and non-fillable PDF forms automatically. By leveraging pypdf for interactive form fields and overlaying text using reportlab for non-fillable documents, the process accurately populates standardized application forms with provided data.

What is the best way to perform OCR on scanned PDF documents?

The best way to perform OCR on scanned PDFs is using pytesseract combined with pdf2image. This approach converts scanned document pages into images, applies optical character recognition, and makes previously unsearchable scanned text searchable and extractable.

Does qpdf support merging, splitting, and rotating PDF files?

qpdf supports merging, splitting, and rotating PDF files. As a command-line tool integrated into the workflow, it handles structural PDF manipulation alongside Python libraries like pypdf, allowing you to reorganize and modify document structures efficiently.

How do I extract data from a batch of PDF forms into a structured format?

To extract data from a batch of PDF forms into a structured format, automate the process using pypdf and pdfplumber. This reads multiple files iteratively, pulls field values and text, and outputs organized data suitable for databases or spreadsheets.

Do I need poppler-utils installed to extract text from PDFs?

You need poppler-utils installed because pdf2image depends on it to render PDF pages into images for OCR. While pypdf and pdfplumber handle direct text extraction without it, poppler-utils is strictly required for processing scanned documents via pytesseract.