Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Webservice with PDF output

Hi all,
I need to display a pdf in a browser. The pdf datas are stored in an oracle db (LOB).
Is it possible to achieve this with a REST Service ? I don't see which output type to use...
I'm using 5.1.1 with DI + ESB Edition.

Labels (2)
8 Replies
Anonymous
Not applicable
Author

You can use the content type: application/pdf.
It may also help to add a Content-Disposition header with "attachment; filename=myfile.pdf".
Anonymous
Not applicable
Author

Thanks for your answer cschneider, but I didn't understand where I have to setup this content-type in the tRestResponse. Well, I guess I have to load my PDF datas in the body of the response, but how ?
.. I didn't find any example of what the XML answer should looks like.
Anonymous
Not applicable
Author

Hi cschneider, for your information :
https://jira.talendforge.org/browse/TESB-8351?focusedCommentId=260364&page=com.atlassian.jira.plugin...
Indeed yesterday I tried with 5.2.1 and http headers but I noticed that PDF binary data (Byte[] out from tOracleInput) are not supported by tRESTResponse, the PDF file I get in the browser is empty
0683p000009MDjG.jpg
Anonymous
Not applicable
Author

Hi Sylvain
Yes, tRESTResponse only supports Document & String for now.
Indeed, expanding a list of supported response types (byte[], possibly Object, and may be in the future: InputStream) will help.
Let us think a bit about it.
Cheers, Sergey
Anonymous
Not applicable
Author

Hi, any update about this feature ?
Anonymous
Not applicable
Author

Hi - unfortunately it did not make it into 5.3.1.
This enhancement request was reviewed exactly yesterday :-), I believe byte[] will be supported by tRESTResponse in few weeks time; I'm also positive that byte[] will be supported by tRESTRequest.
Thanks for driving this enhancement request,
Sergey
Anonymous
Not applicable
Author

By the way, is it something that is a bit of a blocker for you ?
Dietmar had a workaround idea: get byte[] Base64-encoded in tJavaFlex and link the resulting String to tRESTResponse 'string' field and then get this string Base64-decoded in a browser-hosted script. This of course requires a bit of manual coding, but may help in the short term.
If you do decide to go this route, please check if Talend Studio ships a Base64 encoder, otherwise load it with tLoadLibrary (use the library of your choice).

Cheers, Sergey
Anonymous
Not applicable
Author

Hi talend team, is this feature included in the 5.3.1 ?