## Goal Extract text from PDF pages: full text, positioned characters, styled segments, and search. ## Tasks - [ ] Add text FFI to `ffi.rs`: `FPDFText_LoadPage`, `FPDFText_ClosePage`, `FPDFText_CountChars`, `FPDFText_GetUnicode`, `FPDFText_GetCharBox`, `FPDFText_GetText`, `FPDFText_FindStart`, `FPDFText_FindNext`, `FPDFText_GetSchResultIndex`, `FPDFText_GetSchCount`, `FPDFText_FindClose` - [ ] Add safe wrappers - [ ] Implement lazy `FPDF_TEXTPAGE` creation (cached in `PageData`) - [ ] Implement `Document::page_text()` — full text string - [ ] Implement `Document::page_chars()` — `Vec<CharInfo>` with positions - [ ] Implement `Document::page_text_segments()` — runs with shared style - [ ] Implement `Document::search_page()` — find text with options (case-sensitive, whole word) - [ ] Tests: extract text from test PDFs, verify search results, verify character positions ## Exit Criterion Text extraction matches pdfium-render output on test PDFs. Search works. ## Dependencies - #4 (Phase 3 / MVP) - Independent of Phase 5 and Phase 8
Goal
Extract text from PDF pages: full text, positioned characters, styled segments, and search.
Tasks
ffi.rs:FPDFText_LoadPage,FPDFText_ClosePage,FPDFText_CountChars,FPDFText_GetUnicode,FPDFText_GetCharBox,FPDFText_GetText,FPDFText_FindStart,FPDFText_FindNext,FPDFText_GetSchResultIndex,FPDFText_GetSchCount,FPDFText_FindCloseFPDF_TEXTPAGEcreation (cached inPageData)Document::page_text()— full text stringDocument::page_chars()—Vec<CharInfo>with positionsDocument::page_text_segments()— runs with shared styleDocument::search_page()— find text with options (case-sensitive, whole word)Exit Criterion
Text extraction matches pdfium-render output on test PDFs. Search works.
Dependencies