This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!

M Jiva

Greenhorn
+ Follow
since Sep 27, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by M Jiva

And yes i am also worried of the commercial license clause for close code application attached with iText, please suggest any generic way of doing this. but yes somebody suggested that it is possible to cache the pdf generated in the memory(using iText) and then stream the same to the client browser, can you post the code please..

Thank you all
11 years ago
thanks for reply all of you, but i am still looking for code to place my output values in tabular format in a pdf format using streams. how to convert all my values in formatted output (i.e. in tabular format) into binary array and then push that binary array to the client browser.. (i hope the later part is explained in Rene Larsen's post)..

suppose i have this output to be shown as in pdf

serial no name roll number marks
1. XYZ 12345 95
2. PQR 67890 99
.
.
.
.
.
11 years ago
thanks for reply,
here is the code i m trying with ByteArrayOutputStream, but it does not opens any pdf in the browser, instead it says that "Internet Explorer cannot display the webpage"..

please review the code to see what is wrong..
11 years ago
i have some strings and numeric values to be shown in pdf format at the client end, the how to pour this information into a byte stream so that the servlet can stream this information into a pdf?
like i have done a case where i established an input stream which fetched binary data(blob) from the database and then use output byte stream to put that data available in pdf format at the client end, but here how to go about it?
I am generating some values in my servlet and want these values to be available at the client browser in pdf format.. please provide some sample code to work with..
11 years ago
JSP
i have tried gnujpdf API's, and with that i am able to generate a pdf file carrying the outputs from the servlets. but that makes and saves a pdf file on my server machine, whereas i want to send the output directly to the client browser in the form of pdf file which the user can download. i dont want to create any intermediate pdf files on my server machine..

Here is the servlet code i am trying, i want to print things in pdf form..

11 years ago
I too want the same this, i.e to get the response in pdf format and without creating any intermediate file (which iText will create)..
please provide any example code if any of you have..
I think this can be done with streams but do not have a working code..
please help..
11 years ago
JSP
hi
i want to sent the response output of my servlet to a the user as a pdf. like as the user selects a particular set of options, the servlet does some calculations and should send a pdf as an output to the user..
So basically,I want to generate PDF content to be served up directly through a servlet with no intermediary file in the file system..

I think we can do this using streams but i am not able to get my code correct.

Can anybody provide me with any example code where i can put my calculations done in the servlet in pdf format to the user.. i have gone through iText documentation and feel that iText is used to write the output to a pdf file but here i do not want to generate any intermediate file and want the output to be directly presented to the user in pdf format..

please help!!
11 years ago
Hi
Description: I want to pass a integer parameter and the selected value from a drop down box to a servlet using a href link. The visible jsp code is written in a java servlet. When i fetch the values of the passed parameters in the next servlet("ToggleStatus" in my case) i get the correct value for the integer parameter ("emp_no") but for the drop down value parameter "rg" it shows "form.this.reason[selectedindex].value" instead of the actual value.


This code is written in a java servlet.

int emp_no=20;

String reason1="";
reason1="good";
reason2="bad";
out1.println("<form name='try' id='try'><table>");

out1.println("<tr><td>"+emp_no+"</td><td><select name='reason' id='reason'><option value='0'>Select Action</option><option value='1'>"+ reason1 +"</option><option value='2'>"+ reason2 +"</option></td><td><a href='ToggleStatus?emp_no="+emp_no+"&rg=form.this.reason[selectedindex].value'>Change</a></td></tr>");

out1.println("</form></table>");

Result:
String emp_no=request.getParameter("emp_no");
String rg=request.getParameter("rg");
system.out.println("emp_no = "+emp_no+" :: rg = "+rg);

Output:

emp_no = 20 :: rg = form.this.reason[selectedindex].value

Where the expected result is rg = 1 (if i select the first option)
I would appreciate any help in this regard.
11 years ago
JSP