tags:

views:

191

answers:

4

We have an HTML page which displays a bunch of pretty bars using divs and repeating backgrounds. We are in the process of making a report out of this that can be printed nicely, but this may take some time because we don't have a reporting framework in place. As an interm solution we'd like to make the HTML version printable. The background of the divs are the only problem, and they don't print because of the default setting (which can't be enabled because the workstations are locked down).

I have found a work around for printing background images, but this doesn't work when the background needs to be repeated.

Are there any other work arounds which might be able to help? I have also been trying to insert an image inside the dive and stretch it, but this is throwing off all the other relative positions and is proving to be very difficult to fix. I am still looking into this however.

A: 

If you can educate your users, there is an option in the print dialog box of IE and Firefox that is labeled something like 'Include Background Images' or 'Print Background Images'

This will include repeating background images.

Mike
Unfortunately the workstations are locked down and their settings cannot be changed.
Bob
Sorry, you are SOL then. :(
Mike
A: 

I have used this ActiveX Component in situations where controlling the printer output was absolutely neccessary (think printing stickers etc).

The function you'd want is : printBackground

However this doesn't come with their free license but perhaps the cost of that license outweigh the other work arounds implementation time.

Drawback: IE only.

Martijn Laarman
Thanks for the link. It looks like this might be the only way to get the behavior needed, but unfortunately the workstations are locked down.I think my end solution will be to generate the bars server side as an complete image.
Bob
A: 

I couldn't load the link, and I may not be understanding the problem correctly, but...

This is more of a work-around than a solution, but would you be able to make a single image that just appears to be repeated? Or at least, is repeated (for variable browser and screen sizes), but is large enough to be 'proper' for printing (which is a much more standard size)?

Ckhrysze
A: 

The easiest way I can think of achieving this is to have different stylesheet for printing that uses standardised images that fit the containers printed on paper.

The display stylesheet would continue to use the repeated images which wouldn't hinder performance as the full images loaded in the print stylesheet would only be loaded when the page is sent to the printer.

...at least, that's what the HTML spec says should happen. Whether this is actually the case, I can't be 100% sure.

BenAlabaster