Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to encode object (pdf) to base64 so that I can create a routine ?

Hi Team,

I am a beginner with Talend API and I need help with the following scenario.

We have a pdf file to be converted to base64 format so that I can upload it to a web.

 

If I use an online tool to convert a pdf to base64 format I can upload. But in my case I have multiple pdfs coming into the flow which has to be converted to base64 format.


So I am looking for a reusable routine for my flow. 
 The below attachment is an image to base64 format, I need an object (pdf) to base 64.

 

Thanks in Advance.

Regards

 

Labels (3)
2 Replies
Anonymous
Not applicable
Author

Hi,

 

     You should be able to do it through custom code within a Talend routine.

 

     Could you please check below link to get sample Java code.

 

https://www.baeldung.com/java-base64-image-string

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

TRF
Champion II
Champion II

Here is an example using a tJavaRow to convert files before to upload then to salesforce. That's exacty what you are looking for.
https://community.talend.com/t5/Design-and-Development/resolved-Upload-Attachment-into-Salesforce/m-...