View Single Post
  #2 (permalink)  
Old Mar 5th, 2007, 17:07
badlyDrawnToy badlyDrawnToy is offline
New Member
Join Date: Jan 2007
Location: Manchester
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Possible to convert JSP to PDF? - page content gets cut off when printed out

Yep. It most definitely can be done using server-side Java. The iText library is the most popular.

Dong it this way, of course requires a round-trip back to the server to re-produce the content, and you'll need to set the mime-type appropriately.

If you use an MVC framework, such as strut/webworks, you'll find it's easy to implement.

I'm surprised you've had little luck with the CSS solution. I usually provide a print.css. Admittedly, it has a long way to go, but the modern browsers provide pretty good CSS support. No, they can't over-ride printer settings.

Perhaps your print CSS needs to re-set the margins in use by other style sheets? Make sure your screen styles are limited to the screen media and are not over-riding/complicating anything.
Reply With Quote