This is a discussion on "Possible to convert JSP to PDF? - page content gets cut off when printed out" within the Other Programming Languages section. This forum, and the thread "Possible to convert JSP to PDF? - page content gets cut off when printed out are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Possible to convert JSP to PDF? - page content gets cut off when printed out
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
I've designed my web pages to fit within the 800x600 resolution.
Upon printing out a page on my printer, I was surprised to find that the content gets cut off. Its obvious that the margins are, by the printers default, set to too large of a value, because there was room to spare on the sheet. I'm designing my site to be "user friendly", so for the pages that need to be printed out, they will have to fit on the page properly, and I can't expect the user to go into the page setup and set the printers default margins to a smaller value. It was suggested by a member of this forum to use CSS print style sheets. I looked into these print style sheets and found that setting the margins for the page won't make much difference when the page is printed out. The CSS code won't be able to override a users printers default margin settings, right? So how about converting my JSP page into PDF? Can it be done? and what do I need to do this? OR - are there some Java classes available to help with the orientation/setting of margins of a page for proper printout? Need some advice Thank you in advance. |
|
|
|
#2
|
|||
|
|||
|
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. |
![]() |
| Tags |
| convert jsp, pdf, print margins |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HELP! Positioning of content on my web page | lisafelst12 | Web Page Design | 3 | May 6th, 2008 11:29 |
| How to convert HTML Page to PDF in ASP.net, C#.net | Jagdish | ASP.NET Forum | 6 | Jun 9th, 2007 08:02 |
| A gap appears beween the Page Title and the Body Content of the page. | sovereign6 | Web Page Design | 6 | Dec 18th, 2006 20:14 |
| page content stops at certain point | AdRock | Web Page Design | 4 | Sep 22nd, 2006 08:40 |