refactor: redesign public API for better usability

- Remove `process_mode` from `MarkdownOptions` (it controlled the
  pipeline, not markdown formatting)
- Remove dead `text` field from `PdfProcessResult`
- Add `PdfOptions` builder consolidating mode, detection, markdown,
  and page filter configuration
- Add convenience functions: `detect_pdf()`, `detect_pdf_mem()`,
  `process_pdf_with_options()`, `process_pdf_mem_with_options()`
- Eliminate double document parsing: load once, share between
  detection and extraction via internal `pub(crate)` helpers
- Deprecate old `process_pdf_with_config*` functions (kept as shims)
- Update binaries to use new API

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-02-25 13:00:21 -08:00
co-authored by Claude Opus 4.6
parent 4ed73f7c3b
commit f37c911e8e
7 changed files with 318 additions and 356 deletions
+2 -2
View File
@@ -134,8 +134,8 @@ pub(crate) fn extract_text_with_positions_mem_and_rects(
// Orchestration
// ---------------------------------------------------------------------------
/// Extract positioned text and rectangles from loaded document
fn extract_positioned_text_from_doc(
/// Extract positioned text and rectangles from a pre-loaded document.
pub(crate) fn extract_positioned_text_from_doc(
doc: &Document,
font_cmaps: &FontCMaps,
page_filter: Option<&HashSet<u32>>,