Automated tool that extracts text, tables, images and smart fields from any PDF into clean, labeled Excel files.
Give it any PDF — invoices, travel tickets, receipts, reports, forms — and get a professional 5-sheet Excel file with all the important data extracted and labeled automatically.
- Universal Extraction — Works on any PDF type, not just specific formats
- Smart Field Detection — Automatically identifies document type and extracts relevant fields
- 5-Sheet Excel Output — Summary, Text, Tables, Images, and Clean Extracted Data
- Batch Processing — Process entire folders of PDFs at once
- OCR Support — Handles scanned/photo PDFs with Tesseract fallback
- Product Detection — Extracts product names, quantities, prices from invoices
- Image Extraction — Pulls out images with thumbnails embedded in Excel
| Type | Fields Extracted |
|---|---|
| Invoices | Buyer name, Invoice #, Order ID, Products, Amounts, GST, Addresses |
| Travel Tickets | PNR, Train/Flight #, From/To, Date, Passenger, Fare, Seat |
| Receipts | Transaction ID, Store, Date, Total, Payment Method |
| Reports | Title, Author, Date, Sections |
| Forms | All label-value pairs |
| Any PDF | Key-value pairs, dates, amounts, names, phones, emails, addresses |
pip install -r requirements.txtFor scanned PDF support (optional):
- Install Tesseract OCR
python main.py invoice.pdfpython main.py file1.pdf file2.pdf file3.pdfpython main.py --folder "path/to/pdfs"python main.py invoice.pdf -o result.xlsx
python main.py --folder pdfs/ --output-dir results/python main.py --help
Options:
pdf_paths One or more PDF file paths
--folder Folder containing PDF files to process
-o, --output Output Excel file path (single file mode)
--output-dir Output directory for batch mode
--no-images Skip image extraction (faster)
--no-ocr Skip OCR fallback for scanned PDFs
| Sheet | Contents |
|---|---|
| Summary | Document metadata + all detected fields |
| Text Content | Page-by-page raw text |
| Tables | All tables extracted from the PDF |
| Images | Embedded thumbnails with metadata |
| Extracted Data | Clean, labeled fields ready to use |
| Library | Purpose |
|---|---|
| pdfplumber | Text and table extraction |
| PyMuPDF | Image extraction and metadata |
| pytesseract | OCR for scanned PDFs |
| openpyxl | Excel file generation |
| Pillow | Image processing |
| pandas | Table data handling |
pdf-data-extractor/
├── main.py # CLI entry point (single + batch)
├── pdf_extractor.py # Core extraction (text, tables, images)
├── smart_parser.py # Document type detection + field extraction
├── excel_exporter.py # 5-sheet Excel output with formatting
└── requirements.txt # Python dependencies
PDF File
│
▼
pdf_extractor.py ──→ Extracts raw text, tables, images, metadata
│
▼
smart_parser.py ───→ Detects document type + extracts labeled fields
│
▼
excel_exporter.py ─→ Creates professional 5-sheet Excel file
│
▼
Clean Excel Output
MIT