Forum Moderators: phranque

Message Too Old, No Replies

Printing problem: IBM Websphere presentation template

         

SilverLining

3:26 pm on Mar 29, 2010 (gmt 0)

10+ Year Member



Hi,

I am creating printing templates for a new websites, using IBM Websphere . A template pulls in a menu component which sets the header and footer and then the rest of the data is pulled from the fields filled in on content pages e.g. image, title, description. The HTML is in tact and valid. Problem is when I print a page form Firefox, one of the boxes gets truncated and the content is completely missing (at the bottom of the page). Does not happen in IE8, but I have tested it with PDFCreator and the problem happens here too.

Code sample:

<div class="example">
<div class="header>
Header
</div><!--/header>
<div class="box" id="box1">
<div class="img">
</div>
<div class="title">
</div>
<div class="intro">
</div>
</div><!-- /box -->
<div class="box" id="box2">
<div class="img">
</div>
<div class="title">
</div>
<div class="intro">
</div>
</div><!-- /box -->
<div class="box" id="box3">
<div class="img">
</div>
<div class="title">
</div>
<div class="intro">
</div>
</div><!-- /box -->
<div class="box" id="box4">
<div class="img">
</div>
<div class="title">
</div>
<div class="intro">
</div>
</div><!-- /box -->
<div class="footer">
</div><!-- /footer -->
</div><!-- /example -->


I can post more code if required.

Has anyone experienced this before or know of a possible fix? The boxes are floated left and have a height set, for layout purposes, but removing these styles does not fix the problem.

Look forward to any ideas. Thanks.

StoutFiles

3:41 pm on Mar 29, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<!--/header>


<!-- /header -->

SilverLining

7:49 am on Mar 30, 2010 (gmt 0)

10+ Year Member



I typed that up as an example, so thanks for pointing out my typo, StoutFiles, however the problem regards the bigger picture.

SilverLining

12:26 pm on Mar 30, 2010 (gmt 0)

10+ Year Member



Anyone?

SilverLining

3:34 pm on Mar 30, 2010 (gmt 0)

10+ Year Member



Floats (and absolutely positioned elements) cause a problem when printing from Firefox. This post [webmasterworld.com] led me in the right direction.

damon_cool

7:15 pm on Apr 7, 2010 (gmt 0)

10+ Year Member



My simple observation is you need a print stylesheet.

<link rel="stylesheet" type="text/css" media="print" href="print.css">


Copy your existing style.css file to the print.css and start hacking. Should be fairly easy assuming you know css.

SilverLining

7:59 am on Apr 8, 2010 (gmt 0)

10+ Year Member



Hi Damon. Thanks, I am using a print stylesheet for this. In the end I converted the format for the print pages from divs to tables, so that they didn't have to float: left.