put a target="export" attribute on the link tag.

-igor

On Thu, Jul 7, 2011 at 5:32 AM, ramlael <grambab...@gmail.com> wrote:
> Hi Friends,
>
> I have requirement need to generate pdf with string data which is in byte
> stream and need to open in new window (pop up).  I have used below code ,
> but its displaying in same window, not in pop up.. please can you help me on
> this.
>
>  public void downloadPdf(RequestCycle requestCycle, final String
> eStatement, String filename) {
>
>        final WebResponse webResponse = (WebResponse)
> requestCycle.getResponse();
>        webResponse.setContentType("APPLICATION/PDF");
>        webResponse.setHeader("Content-Disposition", "inline; filename=\"" +
> filename + "\"");
>        requestCycle.setRequestTarget(new IRequestTarget() {
>
>            public void respond(RequestCycle requestCycle) {
>                try {
>
>                    OutputStream stream = webResponse.getOutputStream();
>                    OutputStreamWriter writer = new
> OutputStreamWriter(stream, "ISO-8859-1");
>                    writer.write(eStatement);
>                   writer.flush();
>                    writer.close();
>                } catch (IOException ex) {
>                    ex.printStackTrace();
>                }
>            }
>
>            public void detach(RequestCycle requestCycle) {
>            }
>
>        });
>    }
>
>
> Thanks in advance
> Rambabu
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3651354.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to