{"record":{"id":"a505a7f8ecee9e85","repo":"n8n-io/n8n","slug":"pdf-attachment-filename-contains-no-extractab","errorCode":null,"errorMessage":"PDF \"${attachment.fileName}\" contains no extractable text (it may be a scanned image).","messagePattern":"PDF \"(.+?)\" contains no extractable text \\(it may be a scanned image\\)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@n8n/instance-ai/src/parsers/pdf-parser.ts","lineNumber":50,"sourceCode":"\tconst { PDFParse } = await import('pdf-parse');\n\n\tconst parser = new PDFParse({ data: decoded });\n\tlet extractedText: string;\n\tlet totalPages: number;\n\ttry {\n\t\tconst result = await parser.getText();\n\t\textractedText = result.text;\n\t\ttotalPages = result.total;\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : 'unknown error';\n\t\tthrow new Error(`Failed to parse PDF \"${attachment.fileName}\": ${message}`);\n\t} finally {\n\t\tawait parser.destroy();\n\t}\n\n\tconst text = extractedText?.trim() ?? '';\n\tif (!text) {\n\t\tthrow new Error(\n\t\t\t`PDF \"${attachment.fileName}\" contains no extractable text (it may be a scanned image).`,\n\t\t);\n\t}\n\n\tif (text.length > MAX_RESULT_CHARS) {\n\t\treturn {\n\t\t\ttext: text.slice(0, MAX_RESULT_CHARS),\n\t\t\tpages: totalPages,\n\t\t\ttruncated: true,\n\t\t};\n\t}\n\n\treturn { text, pages: totalPages, truncated: false };\n}\n","sourceCodeStart":32,"sourceCodeEnd":65,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/instance-ai/src/parsers/pdf-parser.ts#L32-L65","documentation":"Error \"PDF \"${attachment.fileName}\" contains no extractable text (it may be a scanned image).\" thrown in n8n-io/n8n.","triggerScenarios":"Thrown at packages/@n8n/instance-ai/src/parsers/pdf-parser.ts:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}