n8n-io/n8n · error

PDF "${attachment.fileName}" contains no extractable text (i

Error message

PDF "${attachment.fileName}" contains no extractable text (it may be a scanned image).

What it means

Error "PDF "${attachment.fileName}" contains no extractable text (it may be a scanned image)." thrown in n8n-io/n8n.

Source

Thrown at packages/@n8n/instance-ai/src/parsers/pdf-parser.ts:50

	const { PDFParse } = await import('pdf-parse');

	const parser = new PDFParse({ data: decoded });
	let extractedText: string;
	let totalPages: number;
	try {
		const result = await parser.getText();
		extractedText = result.text;
		totalPages = result.total;
	} catch (error) {
		const message = error instanceof Error ? error.message : 'unknown error';
		throw new Error(`Failed to parse PDF "${attachment.fileName}": ${message}`);
	} finally {
		await parser.destroy();
	}

	const text = extractedText?.trim() ?? '';
	if (!text) {
		throw new Error(
			`PDF "${attachment.fileName}" contains no extractable text (it may be a scanned image).`,
		);
	}

	if (text.length > MAX_RESULT_CHARS) {
		return {
			text: text.slice(0, MAX_RESULT_CHARS),
			pages: totalPages,
			truncated: true,
		};
	}

	return { text, pages: totalPages, truncated: false };
}

View on GitHub (pinned to 5ac6606e81)

When it happens

Trigger: Thrown at packages/@n8n/instance-ai/src/parsers/pdf-parser.ts:50 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/a505a7f8ecee9e85. Report an issue: GitHub.