Parse a pdf and extract the text

Trying to parse a pdf and extract the text from the Chat trigger. I pass a message and attach a PDF in the Chat input. I then parse the PDF through the “Code” node to get it into binary format

const inputData = $input.all();

return inputData.map(entry => ({
binary: {
data: entry.json.files[0] // Assigning the first file as binary data
}
}));

I then parse this to the “Extract from PDF” node, but get the fololowing error message

Item Index

0

Node type

n8n-nodes-base.extractFromFile

Node version

1 (Latest)

n8n version

1.75.2 (Self Hosted)

NodeOperationError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined at

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Take a look at these topics.

:muscle: If my reply answers your question, please remember to mark it as a solution.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.