Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I'm retreiving a PDF file from an API request ("POST").
I'm getting trouble in storing the PDF File.
I'm trying using tJavaRow but I generated i blank file.
Is there others tool or some java code that should help me?
Among all codes, the last one I tried
String inputString = input_row.PDFDaConvertire;
byte[] byteArrray = inputString.getBytes("UTF-8"); //I tried with also ASCII and ISO
8859-1
Files.write(Paths.get("out.pdf), byteArrray);
Solved , changing approach, using tFileFetch.
https://community.talend.com/s/question/0D53p00007vCqFGCA0/resolved-is-possible-to-download-a-file-through-trestresponse?language=en_US
Hi
I am not a specialist in Java, make sure you have the expected response string from API, we usually use tLogRow to print the response on console for debugging. To write a PDF, this page recommended to use PDF libraries like iText or Apache FOP or the custom component shared on Talend Exchange, such as tOutputPDF2
Regards
Shong
Not working. The tRestClient that retreive the PDF with a POST API call, pass the file in String to the next component. Using a string to pass the file means losing data to rebuild it and the tOutputPDF just create a PDF of the string.
I'm trying to use tHttpRequest but i got the error 411
Solved , changing approach, using tFileFetch.
https://community.talend.com/s/question/0D53p00007vCqFGCA0/resolved-is-possible-to-download-a-file-through-trestresponse?language=en_US