Hello,
I’m building a workflow in n8n to process a PDF document that contains images. I need to extract the images from the PDF and use OpenAI to generate descriptions for them. Could you please recommend which n8n nodes I should use for this?
Hi Walker,
Check this workflow: Automate PDF Image Extraction & Analysis with GPT-4o and Google Drive | n8n workflow template
Manual Trigger: Start workflow.
Extract from File: Set to extract images from PDF.
Function: Convert images to base64:
javascript : "
return $input.all().map(item => ({
json: { image: data:${item.binary.data.mimeType};base64,${Buffer.from(item.binary.data.data, 'binary').toString('base64')}
}
}));
"
OpenAI: Analyze images with gpt-4o, prompt: “Describe this image in detail.”
Google Sheets: Store descriptions.