I am developing one web project using Flex/JSP/Java... In my project i have to set two buttons, one for downloading data in excel sheet and other one for downloading data in pdf file..for downloading data in excel sheet i use the following code..
this is working fine...
when i use the same code with some modifications for downloading data in pdf file it is causing problem...
the code which i use is
what type of code i have to use for downloading data in pdf file through jsp...
HTML is not PDF. Just because you tell the browser that you're sending it PDF, isn't going to transform HTML into PDF. You need to generate a real PDF format. There are a number of 3rd party libraries to do this. Do a google search for them.
but what my actual need is to create document and to ask user "save or open"....we have to give the option for storing the document where he needs to save..
what to do for that....
Joined: Sep 21, 2011
The iText version you're using (iText 5) is covered by the GNU Affero license, which makes it non-free for most business uses. Make sure you (and your company's lawyer) understand what that means.
You should not use JSPs for doing this kind of stuff; that's what servlets are for. Java code has no place in JSPs.
You need to stream the PDF data to the client in order to get the Save/Open option; search for "streaming binary data from a servlet" or some such phrase. This has been discussed multiple times in these forums.