pdf

Extract text, tables, and metadata from PDFs using Python and CLI tools.

4.4k|512|Updated Aug 3, 2023
One-click install
npx skills add https://github.com/modelscope/ms-agent --skill pdf-modelscope
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf
Source: https://github.com/modelscope/ms-agent/tree/main/projects/agent_skills/skills/pdf
Command: npx skills add https://github.com/modelscope/ms-agent --skill pdf-modelscope

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, reportlab, pytesseract, pdf2image, pandas, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill eliminates the tedious, error-prone manual work of processing PDF documents. It automates everything from data extraction and form filling to document merging and splitting, saving you countless hours and ensuring accuracy.

Core Features & Use Cases

  • Intelligent Data Extraction: Accurately pull text, tables, and metadata from any PDF.
  • Automated Form Filling: Programmatically fill both fillable and non-fillable PDF forms with precision.
  • Document Manipulation: Merge, split, rotate, and create new PDFs from scratch.
  • Use Case: A legal team needs to process hundreds of contracts, extracting specific clauses and filling out standardized forms. This Skill can automate the entire workflow, extracting relevant data, populating new documents, and even adding watermarks, drastically reducing manual effort and potential errors.

Quick Start

Use the pdf skill to extract all tables from the attached financial report 'annual_report_2024.pdf' and save them as an Excel file.

Frequently Asked Questions about pdf

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

FAQPage Schema
How do I extract tables and text from PDF files?

Extract tables and text from PDFs using pdfplumber for precise table parsing and text retrieval, or pypdf for broader text extraction. Both libraries handle structured and unstructured content, returning data you can export to Excel, CSV, or JSON formats.

Can I automate filling out PDF forms programmatically?

Yes, automate form filling by using pypdf or reportlab to programmatically populate both fillable and non-fillable PDF forms with data. Define form field mappings in JSON or use annotation-based methods to insert values at exact positions.

What's the best way to merge, split, and rotate PDF documents?

Merge, split, and rotate PDFs using pypdf for comprehensive document manipulation, or qpdf via CLI for command-line workflows. Both handle multi-page operations, allowing you to combine files, extract page ranges, and reorient pages in batch.

How do I extract data from scanned PDF documents with OCR?

Extract text from scanned PDFs by converting pages to images with pdf2image, then applying pytesseract for OCR recognition. This workflow handles low-quality scans and image-based content, returning searchable text and structured data.

Can I create new PDFs from scratch and add content programmatically?

Create PDFs from scratch using reportlab to generate documents with text, tables, images, and formatting. Combine with pypdf to merge generated content with existing documents and handle metadata, watermarks, and page modifications.

Do I need command-line tools or can I work entirely in Python?

Work entirely in Python with pypdf, pdfplumber, and reportlab for most tasks. CLI tools like pdftotext and qpdf offer alternative workflows for batch processing, but Python libraries provide programmatic control and integration into larger automation pipelines.

Related Skills