wood burning stoves 2.0*
The moose likes Servlets and the fly likes modified PDF/image to be sent to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "modified PDF/image to be sent to servlet" Watch "modified PDF/image to be sent to servlet" New topic
Author

modified PDF/image to be sent to servlet

Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
Hi,
I am able to retrieve a document from a fileserver and show it in a browser by setting :
response.setContentType("application/pdf");
ServletOutputStream outStream = response.getOutputStream();
outStream.write(content);

I am planning to have two frames one for the PDF and other frame will have the "SUBMIT" with other input form fields.Now if im adding some comment/annotations to the PDF( using PDF writer) and submitting the page, i need to save the modifed PDF to the file server back again along with the form fields to some DB.

Could somebody reply how it can be achieved?

Rgds,
prem.
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 140
If you are setting the content type of a request to pdf, then you cannot have a normal html/jsp page in the lower frame of your page.


Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
well im able to view both the frames(one with pdf and other with Html). wht u mean by normal html/jsp??
Still my query is how can i submit the changed PDF along with the Html form.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
Hi Prem,

you will have to use multipart/form-data to submit such type of content types like images, pdfs, docs...etc

The submission would be a two step process.

1. you will need to save the pdf after entering the annotations on your local machine.

2. use <input type="file" >
to submit this pdf along with the other fields in your form.


LXI Technologies P Ltd
[url]www.lxisoft.com[/url]
Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
Thnks ajith, but whtever u say is jus file upload rite; U have to save it then give the path where the file is stored.. well that should be my last option.
Ajith Anand
Ranch Hand

Joined: Aug 30, 2004
Posts: 40
Originally posted by Prem Shankar:
Still my query is how can i submit the changed PDF along with the Html form.


Are there any other options left ?? I think that is the only option...ofcourse other than using javascript to simulate the same....Let me know if you have something else in mind ...
Prem Shankar
Greenhorn

Joined: Jul 28, 2003
Posts: 21
Ajith:
yeah i agree i dont have any options either...but how can u simulate the same using javascript ...(getting the modified PDF and sending it to controller from other frame)..
 
 
subject: modified PDF/image to be sent to servlet
 
Similar Threads
PDF in the background of the Panel (Experts only)
Saving Edited PDF Forms using iText
JUnit Pocket Guide: Where to put your tests
pdfbox
FormBean - Hidden variable not set