• 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

Open file from JSP or Servlet in Acrobat reader

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have several files, which I need to open from servlet or JSP page in acrobat reader.
These files are partially protected, so if user opens them in Acrobat, print and save options are disable.

I have following code in my servlet:

url = "/RESULT2.pdf";
RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher(url);
requestDispatcher.forward(request, response);

In this case, file is open in IE and user could print it.

Thanks in advance,
Julia
[ July 31, 2005: Message edited by: Julia Smith ]
 
Ranch Hand
Posts: 472
Objective C Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you provide a bit more information, like version of Acrobat, version of pdf, how you did protection? You can try to copy your pdf under static web server content and open it without involving a servlet in IE to compare results.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you set the content-disposition header to 'attachment' (as opposed to 'inline') and then stream the PDF to the browser, the user will be shown a save/open dialog. If they choose to open, it will open a seperate instance of acrobat.
 
Julia Smith
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,
Thank you for your help, this is working.
But if I am trying to open the same file second time,
it opens in IE instead of Acrobat.
How could I prevent it?
Thanks in advance
Julia

[ July 31, 2005: Message edited by: Julia Smith ]
[ July 31, 2005: Message edited by: Julia Smith ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic