• 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

Displaying a PDF with Struts2

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am able to retrieve a PDF and display it in the browser, but the PDF takes up the entire page when it is returned. I would like to wrap it in a div or something, so that I can provide a back button to return the user to an action. Right now, the user has to click on the back button, which is inconsistent with the rest of my application. This all happens despite all of my attempts to wrap the PDF in a div, iframe, specifying the width, etc...

In the JSP


In the struts.xml, I am returning an InputStream


How can I get this PDF to show up in a div or iframe, so that I can specify the width and a button for the user to provide consistent navigation? I can display XML files in this way with no problems, but the PDF documents are not behaving the way I want them to.
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic