views:

3869

answers:

6

We have Flex on the front end and Java on the back end. When a user will request for a PDF file, request will go to the Java backend, where a PDF file will be generated using Jasper Reports. What we dont know is how to display this PDF file in browser; since we dont want to use JSP/Servlets etc - It has to be flex only. Any suggestions?

A: 

Well for starters, PDFs don't always display in the browser. It depends on the user's settings. You essentially header them the pdf file and either they download it or a program like Acrobat Reader opens in the browser to display it.

Not sure how this is done in flex, I would imagine if you're using Java one simple servlet could do it.

tkotitan
Yes, you are right. I meant that only, may be it was not clear.With Servlets it's simple, but we want to avoid that for reasons unknown to me :)
Akshay
A: 

Have you had a look at http://www.jpedal.org/FlexViewer/RC1/Viewer.html ?

+1  A: 

Flash Player cannot natively render PDF files. This is possible using Adobe AIR but not in a Flex application. Your best bet is to call navigateToURL() and open a Servlet in a new browser tab/window. The Servlet can simply write contents of the PDF file to the OutputStream and set the appropriate HTTP headers.

cliff.meyers
A: 

Check out the open source AS3 pdf generation library AlivePDF.

Rydell
+1  A: 

i think this question is old, but it may help others, there's a new library developed by Jasper Forge them selves, which deals with JasperReports directly, i mean it's not a PDF viewer, but a JasperReport exporting tool, you can download it from here

i tried it through using JasperServer, when viewing reports you can choose from different options to export it, one of them is flash, and it's working nice

Amr Faisal
+1 I use Jasper for all of my projects
Adnan
A: 

Check out arx flex report designer http://www.arx-reports.com/

thunder