Web Design and Development Forums

Possible to convert JSP to PDF? - page content gets cut off when printed out

This is a discussion on "Possible to convert JSP to PDF? - page content gets cut off when printed out" within the Java, JSP, Cold Fusion 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.


Go Back   Webforumz.com > Program Your Website > Java, JSP, Cold Fusion

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Mar 5th, 2007, 15:37   #1 (permalink)
Junior Member
 
Join Date: Feb 2007
Location: USA
Posts: 45
Question Possible to convert JSP to PDF? - page content gets cut off when printed out

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.
Love2Java is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Mar 5th, 2007, 17:07   #2 (permalink)
Junior Member
 
Join Date: Jan 2007
Location: Manchester
Posts: 11
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.
badlyDrawnToy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
convert jsp, pdf, print margins

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Content On A Seperate Page josephman1988 Perl, Python, Ruby and Others 0 Sep 20th, 2007 13:42
How to convert HTML Page to PDF in ASP.net, C#.net Jagdish ASP.NET Forum 6 Jun 9th, 2007 08:02
? about table width - printing page = content cut off Love2Java HTML Forum 6 Feb 20th, 2007 12:42
A gap appears beween the Page Title and the Body Content of the page. sovereign6 HTML Forum 6 Dec 18th, 2006 19:14
page content stops at certain point AdRock HTML Forum 4 Sep 22nd, 2006 08:40



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 16:24.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59