Skip to content

Add opt-in PDF page boundary markers - #2451

Open
Michelle Matias (michelleangela) wants to merge 2 commits into
microsoft:mainfrom
michelleangela:feature/pdf-page-markers
Open

Add opt-in PDF page boundary markers#2451
Michelle Matias (michelleangela) wants to merge 2 commits into
microsoft:mainfrom
michelleangela:feature/pdf-page-markers

Conversation

@michelleangela

Copy link
Copy Markdown

Summary

Add opt-in preservation of PDF page boundaries.

  • Add the --pdf-page-markers CLI option.
  • Add the pdf_page_markers=True Python API option.
  • Emit one-based <!-- page N --> markers before every PDF page.
  • Preserve markers for empty pages so page indexes do not shift.
  • Preserve boundaries across plain-text, table/form, and mixed-content PDFs.
  • Use page-scoped extraction fallbacks when markers are enabled.
  • Keep default PDF conversion behavior unchanged.
  • Add no new dependencies.

Addresses #1317

Example

<!-- page 1 -->

First page content

<!-- page 2 -->

Second page content

Testing

  • pre-commit run --all-files 
  • PDF-marker, CLI, Content Understanding, PDF memory, PDF table, and MasterFormat tests: 173 passed, 2 skipped
  • Full local Windows run: 649 passed, 5 skipped; remaining failures were related to Windows console encoding, Windows file-URI expectations, and unavailable FFmpeg

@michelleangela Michelle Matias (michelleangela) changed the title Add opt-in PDF page boundary marker Add opt-in PDF page boundary markers Sep 10, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant