Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Recreate a PDF from an Online PDF

Hello,
I'm starting with Talend and I'm not sure if what I want to do is possible or not 0683p000009MACn.png.

I want to recover a PDF file from a Rest API (I'm using an OpenBee API) and send it as an attachment in an email.

For now I manage to recover the url of my file but when I make a GET request on this URL, it sends me the PDF code of my file. After that, I can not properly reform it because the encoding is UTF-8 and converting back to ANSI does not change anything.

How can I do to resolv this problem ? 

Thank you in advance, 

Regards,

Jb


Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Actually, I've rethought this. Use the tFileFetch component. That should handle everything for you.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

If you simply click on the URL (or use it in a web browser) does it return the PDF as expected? If so, I suspect you may be receiving a text representation of the byte code back. If so, try connecting it to a tFileOutputRaw component and that might solve this for you.

Anonymous
Not applicable
Author

Hi,

Thanks for replying. I think you're right because the URL returns the PDF as expected. So it gives me a text representation of the byte code I think 0683p000009MACn.png

The problem is from the encoding, I think, because my tRestClient is getting the text representation of the byte code in UTF-8 and there's some characters that it does not understand. Encoding it back in ANSI does not change anything either...
I already tried to connect a tFileOuputRaw after my tRestClient but it only gives me a blank page 0683p000009MPcz.png

Regards, 

Jb

Anonymous
Not applicable
Author

Actually, I've rethought this. Use the tFileFetch component. That should handle everything for you.

Anonymous
Not applicable
Author

That is what I was looking for. Thank you very much for your help. I just have a last problem with authentication with my http address ...

Regards, 

Jb