enquire-mcp API reference - v3.9.0-rc.4
    Preparing search index...

    Function ocrPdf

    • Run Tesseract OCR over a PDF's page bitmaps — the image-only / scanned counterpart to readPdf.

      When readPdf returns has_text: false, the PDF is image-only; this function renders each page via @napi-rs/canvas and runs Tesseract over the bitmap. Tesseract.js + @napi-rs/canvas are optionalDependencies — without them the function surfaces a clean install-hint error rather than crashing. Costs ~1-3s/page on a modern laptop at default scale.

      Parameters

      Returns Promise<OcrPdfResult>

      An OcrPdfResult with per-page text, confidence scores, and aggregate statistics.

      If path is empty / missing / excluded, or the OCR optional deps aren't installed.

      If path resolves outside the vault.

      const r = await ocrPdf(vault, {
      path: "Papers/scanned-1978.pdf",
      lang: "eng+fra",
      pages: [1, 10],
      scale: 3
      });
      console.log(`OCR confidence: ${r.mean_confidence}/100`);