How aryangiri03/adobe-hackathon-round1a works
This repository is a single-script PDF-to-JSON outline processor. Its user workflow is to place PDFs in the configured input directory, run the script, and receive one JSON outline per document in the output directory. The script detects scanned versus text-based PDFs, extracts text using the corresponding route, infers headings from text attributes and layout, then formats and writes results. The excerpts show these stages within process_pdfs.py; OCR internals and the final write details are only partially shown, so those links are documented or marked unverified where appropriate.
Main entry points: process_pdfs.py Batch runner · input PDF inputs · ouput JSON outputs · output_schema.json Output schema
Components 13
PDF processing
- PDF inputs
input - Batch runner
process_pdfs.py - Outline formatter
process_pdfs.py - JSON outputs
ouput
Document analysis
- Scan detector
process_pdfs.py - Text extraction
process_pdfs.py - OCR extraction
process_pdfs.py - Font analysis
process_pdfs.py - Heading detection
process_pdfs.py
Other components
- PDF operator
- PyMuPDF
- Tesseract OCR
- Output schema
sample_dataset/schema/output_schema.json
Connections 18
- PDF operator → PDF inputs: provides PDFs
README.md - PDF inputs → Batch runner: reads PDFs
README.md - Batch runner → Scan detector: classifies each
process_pdfs.py - Scan detector → PyMuPDF: inspects PDF
process_pdfs.py - Batch runner → Text extraction: uses text route
process_pdfs.py - Batch runner → OCR extraction: uses scanned route
process_pdfs.py - Text extraction → PyMuPDF: extracts text
process_pdfs.py - OCR extraction → Tesseract OCR: recognizes text
README.md - Text extraction → Font analysis: returns text attributes
process_pdfs.py - OCR extraction → Font analysis: returns text attributes
process_pdfs.py - Batch runner → Font analysis: analyzes attributes
process_pdfs.py - Batch runner → Heading detection: extracts headings
process_pdfs.py - Font analysis → Heading detection: provides majority attributes
process_pdfs.py - Batch runner → Outline formatter: formats result
process_pdfs.py - Heading detection → Outline formatter: supplies headings
process_pdfs.py - Outline formatter → JSON outputs: writes JSON
README.md - JSON outputs → PDF operator: returns outlines
README.md - Outline formatter → Output schema: conforms to schema
README.md