Skip to content

fix: stop designed / multi-column resumes silently dropping sections in PDF extraction - #401

Open
Sofa3xpert wants to merge 1 commit into
interviewstreet:mainfrom
Sofa3xpert:fix/designed-layout-extraction
Open

fix: stop designed / multi-column resumes silently dropping sections in PDF extraction#401
Sofa3xpert wants to merge 1 commit into
interviewstreet:mainfrom
Sofa3xpert:fix/designed-layout-extraction

Conversation

@Sofa3xpert

Copy link
Copy Markdown

Fixes #400.

Problem

Designed resume templates (Canva, Adobe Express, ...) paint sidebar content over decorative vector panels. extract_text_from_pdf called to_markdown(doc, pages=pages), which treats those panels as significant images and drops every text line over them. Whole sections (skills, education, contact) vanish before the LLM sees them, silently deflating scores.

Before / after

Same persona as resume/sample.pdf (Barack Obama), rebuilt as a Canva two-column layout:

  • default (main) -- 624 chars -- 6 of 14 fields recovered -- entire Contact / Skills / Education sidebar dropped (phone, email, all 4 skills, Harvard Law J.D.)
  • this PR -- 900 chars -- 14 of 14 fields recovered

No regression on layouts that already worked: resume/sample.pdf extracts byte-identically (906 to 906 chars). Verified against main @ 70fd3ea.

Fix

One line in pdf.py, pass ignore_graphics=True to to_markdown:

resume_text = to_markdown(
    doc,
    pages=pages,
    ignore_graphics=True,
)

Vector graphics in a resume are decorative; they must not suppress text. (ignore_graphics also skips markdown table formatting, but table text is still extracted, which is what matters for parsing.)

Test

Adds tests/pdf_extraction_test.py, a hermetic PDF to Markdown smoke test (no API key or network): it builds the Canva-style fixture and asserts the sidebar survives extraction. Fails on main, passes with this change. Black-clean; pytest-discovered and runnable standalone.

Run python tests/pdf_extraction_test.py (or pytest tests/).

Note: named *_test.py rather than test_*.py because the repo's .gitignore ignores test_*.py.

…eep their text

Designed resume templates (Canva, Adobe Express, ...) paint sidebar content over
decorative vector panels. to_markdown treated those panels as significant images
and dropped every text line over them, silently losing whole sections (skills,
education, contact) before the LLM saw them.

Pass ignore_graphics=True in extract_text_from_pdf. Non-regressing on simple
layouts (resume/sample.pdf extracts byte-identically); recovers the dropped
sidebar text on designed layouts. Adds tests/pdf_extraction_test.py as a
regression guard.

Fixes interviewstreet#400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Bug: designed / multi-column resume layouts (Canva, etc.) silently drop whole sections during PDF to Markdown extraction

1 participant