Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating and Displaying PDF file in Flex/Java

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?

like image 590
Akshay Avatar asked Sep 18 '26 20:09

Akshay


1 Answers

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.

like image 124
cliff.meyers Avatar answered Sep 20 '26 10:09

cliff.meyers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!