I am about to do a similar thing Rendered JPEG images.
Sending back binary content should be
possible from Struts Action. In the action perfrom() you return `null'
to signify that you handling the response by yourself. Generating
custom response is the same, then, as a Java Servlet.
You have to set content type. For you it would be
response.setContentType("text/pdf") or whatever the MIME type is pdf is.
Then you have to get reference to the ServlketOutputStream

ServletOutputStream out = response.getOutputStream();
Buffer it up and send your binary (PDF) stream down stream.
Dont forget to flush().

That should be it unless any body knows otherwise.
--
Peter Pilgrim                 ++44 (0)207-545-9923
                                                      //_\\
"Mathematics is essentially the study of islands of  =======
disparate subjects in a sea of ignorance."           || ! ||
Andrew Wiles _____________


---------------------------------------- Message History 
----------------------------------------


From: "IZAGA,IGNACIO (HP-Germany,ex1)" <[EMAIL PROTECTED]> on 14/11/2001 13:01 CET
--MCIT>


Hi,

I am trying to generate a PDF document on the fly based on dynamic html
generation comming from BroadVision.

I am using a tool called HTMLDOC that can use as input parameter a html file
or a URL.

If i used this tool directly from the command line,

htmldoc URL -f result.pdf

then, the pdf generation is fine, includig images.


But if i called this via an action, and i get the ouput of the tool and send
it to the response, the pdf result is not displayed if i used the image tag
in the HTML.

This is the java code for my action :

--<CUT>--


--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to