Scanned pages are reported, not dropped
A PDF with scanned or image-only pages used to convert with those pages silently missing, and a fully scanned one failed as unsupported. Conversion now fails naming the pages: ConvertError::NeedsOcr { pages, page_count } in Rust, needsOcr with pages and pageCount on the error in Node and wasm, NeedsOcrError with .pages and .page_count in Python, exit code 3 on the CLI.
$ anydoc scan.pdf
anydoc: pages 2, 5-7 of 12 need OCR
Hosted OCR, opt in
anydoc converts locally and does not do OCR. In Node and Python, ocr: 'hosted' / ocr="hosted" (CLI: --ocr hosted) sends a PDF that fails with needsOcr, and only that, to Firecrawl Parse. It works without an account, and setting FIRECRAWL_API_KEY raises the limits. Failures come back as hosted / HostedError. No new dependencies.
const markdown = await toMarkdown('scan.pdf', { ocr: 'hosted' });Node package
The entry point is now anydoc.js, a wrapper over the generated binding. Everything index.js exported is still exported.
Full Changelog: v0.2.3...v0.2.4