danielmiessler/Fabric · warning · Error

${fileName} contains no machine-readable text. OCR is necess

Error message

${fileName} contains no machine-readable text. OCR is necessary, and the Fabric web interface does not include OCR.

What it means

interpretPdfResult throws when the WASM pdf-inspector classifies the PDF as 'Scanned' or 'ImageBased' — the file contains only images of text with no extractable text layer. The Fabric web UI deliberately has no OCR, so conversion is impossible and the error tells the user that explicitly.

Source

Thrown at web/src/lib/services/PdfConversionService.ts:12

import type { PdfProcessResult } from '@firecrawl/pdf-inspector-wasm';
import type { PdfRequest, PdfResponse } from '../workers/pdf-inspector.worker';

export interface PdfConversion {
	markdown: string;
	warning?: string;
}

// Maps the raw worker result to UI behavior. Throws when there is no usable text.
export function interpretPdfResult(result: PdfProcessResult, fileName: string): PdfConversion {
	if (result.pdfType === 'Scanned' || result.pdfType === 'ImageBased') {
		throw new Error(
			`${fileName} contains no machine-readable text. OCR is necessary, and the Fabric web interface does not include OCR.`
		);
	}
	const markdown = result.markdown;
	if (!markdown || markdown.trim().length === 0) {
		throw new Error(`${fileName}: the conversion returned no text.`);
	}
	const warnings: string[] = [];
	if (result.pdfType === 'Mixed') {
		warnings.push(
			`${fileName}: pages ${result.pagesNeedingOcr.join(', ')} contain no machine-readable text. OCR is necessary for those pages, and their content is not included.`
		);
	}
	if (result.hasEncodingIssues) {
		warnings.push(`Some text in ${fileName} did not decode correctly.`);
	}
	return warnings.length > 0 ? { markdown, warning: warnings.join(' ') } : { markdown };
}

View on GitHub (pinned to 338b89cfe9)

Solutions

  1. Run OCR on the file externally (e.g. ocrmypdf) and upload the OCR'd copy
  2. Obtain a native-text version of the document (re-export from the source tool)
  3. Surface this message to the user as-is in the UI toast — it already explains the remedy
Defensive patterns

Strategy: validation

Type guard

function isNoTextPdfError(e: unknown): boolean {
  return e instanceof Error && e.message.includes('OCR is necessary');
}

Try / catch

try { conversion = interpretPdfResult(result, fileName); }
catch (e) {
  if (isNoTextPdfError(e)) { toast.info(e.message); return; } // actionable user guidance
  throw e;
}

Prevention

When it happens

Trigger: Uploading a scanned document (photo/scan-of-paper PDF), an exported-as-image PDF, or any PDF whose pages are a single full-page image with no text objects.

Common situations: Users dragging in scanned contracts/receipts; PDFs printed to 'image-only' by scanner software; documents exported from tools that rasterize pages.

Related errors


AI-assisted analysis of danielmiessler/Fabric@338b89cfe9 (2026-08-15). Data as JSON: /api/errors/fab028121efe778d. Report an issue: GitHub.