Hi Bjorn,
here is just the way how we did it:
public void print(ActionEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response =
(HttpServletResponse) context.getExternalContext().getResponse();
response.setContentType("application/pdf");
FpRegisterableEJB bean = null;
try {
bean = createEquipedBean( getLink() );
JCPrinter printer = PrintManager.getPDFPrinter( response.getOutputStream() );
PrintManager.printDocument( getReport( printer , bean ) , printer );
} catch (Exception e) {
logAndRethrowException( e );
} finally{
removeBean(bean);
}
context.responseComplete();
}
regards
Rico
Bj�rn T Johansen <[EMAIL PROTECTED]> schrieb am 28.02.2005 13:06:01:
> I was just wondering how do I return a PDF file as a stream as my
> response using
> jsf/myfaces?
>
>
> Regards,
>
> BTJ
>
> --
> -----------------------------------------------------------------------------------------------
> Bj�rn T Johansen
>
> [EMAIL PROTECTED]
> -----------------------------------------------------------------------------------------------
> Someone wrote:
> "I understand that if you play a Windows CD backwards you hear
> strange Satanic messages"
> To which someone replied:
> "It's even worse than that; play it forwards and it installs Windows"
> -----------------------------------------------------------------------------------------------
>
- Re: Howto return a pdf file as a stream? Rico Wiese
- Re: Howto return a pdf file as a stream? Sean Schofield
- Re: Howto return a pdf file as a stream? Bj�rn T Johansen
- Re: Howto return a pdf file as a stream? Sean Schofield

