Sleetza
Sleetza7mo ago

Converting pdf to base64

I am receiving a pdf in the body as a POST Rest api call and want to convert that pdf to a base64 string so i can save it the way i want in my Supabase db. I tried creating such node with AI but it doenst work. Does anyone has the code or a good prompt to create such node?
Solution:
HI @Sleetza, to make this simpler, you can follow this flow: - PDF to Text (there is a pre-existing node for this). - Then create a node using AI or custom logic to convert text to base64 - pass the result to the Supabase Create node....
Jump to solution
2 Replies
Solution
Gaurav Chadha
Gaurav Chadha7mo ago
HI @Sleetza, to make this simpler, you can follow this flow: - PDF to Text (there is a pre-existing node for this). - Then create a node using AI or custom logic to convert text to base64 - pass the result to the Supabase Create node.
Sleetza
Sleetza7mo ago
Thanks for the idea, ill look into it. For my use case there are edge cases where pdf to text misses information (long story short; some documents contain related data that is stored in different tables for lay out purposes, this leads to LLMs missing data), so pdf to text is not good enough for my use case. Later in the work flow I would like to be able to recreate the document to send to OpenAI or Google Document API. Thanks for the rapid response btw, appreciate it