• 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 PDF in new window

 
Ranch Hand
Posts: 376
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the problem scenario: I need to get a bytearray and display it as a pdf document in a new window from an Action class.

Steps taken so far: I have the bytearray in hand and I am able to set the content type, header etc, and open it as pdf. But it is opening in the current window, and I don't know how to make it open in a window of its own.

Setting the content-disposition to Attachment instead of inline, does open it in a new window, but the user is now required to choose Save or Open in an ugly dialog box, and I don't want that.

Pointers in the right direction greatly appreciated. Thanks
 
kayal cox
Ranch Hand
Posts: 376
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok, this url seems to enlighten me somewhat...

wiki struts solutions
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can use javascript function

window.open('url to open','window name','attribute1,attribute2')

eg:-
window.open('/mywebapp/showpdf.do','pdfwindow','765','600')
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic