• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

modified PDF/image to be sent to servlet

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Prem Shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Prem Shankar
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic