← All write-ups

Parsing PDF Resumes into Structured JSON with Gemini and FastAPI

AI & Document Processing1 min read·Case study: Smart AI Resume Analyzer

Resumes arrive in every layout imaginable, which makes them hard to process with fixed rules. This page covers how I combined PyMuPDF and Gemini 2.5 Flash to turn them into consistent, validated data and highlight keywords directly in the document.

1The problem: unpredictable layouts

Columns, tables and different section orders break simple text extraction. The goal was a tool that reads any resume and returns the same set of fields every time.

2Extracting text and positions with PyMuPDF

PyMuPDF reads the raw text and also gives the position of each word on the page. That position data is what makes it possible to draw highlights over the right place later without damaging the file.

3Getting reliable JSON from the model

Language models can answer in free text, which is hard to use in an application. I used Gemini 2.5 Flash with a detailed system prompt and a JSON response schema, so the output always follows the same structure regardless of how the resume is laid out.

  • A clear system prompt describing every field
  • A response schema that the output must match
  • Validation on the server before data reaches the front end

4Highlighting keywords inside the PDF

When a user searches for a skill, the app finds matching words with their coordinates and draws highlights on the PDF, so a recruiter sees exactly where the skill appears.

5Tech stack

FastAPI and Python on the back end, Gemini 2.5 Flash for extraction, PyMuPDF for PDF handling, and Vue 3 with Vite on the front end.

Need something similar built?

I build and ship platforms like this for startups and retailers. Tell me what you are trying to launch and I will reply with how I would approach it.