views:

884

answers:

3

I have a webpage with a big jpeg file like this one https://www.donationcoder.com/Forums/bb/index.php?PHPSESSID=pee3l52288fspopb9i20dpeuv6&action=dlattach;topic=4066.0;attach=2451;image , but when I print this from IE, I could see only one page is printed that with quarter of the image.

Is there any way I could print the whole image in multiple pages?

Ta, Rajeesh

A: 

I'll assume you are talking about programatically been able to do this, otherwise it's not a programming question. Having said that, I've been looking around and there's seems to be little support for this kind of situation (image printing manipulation) from the CSS specs and browser implementation. FYI, this particular behavior you asked about was even considered a bug in old IE releases. Now, if you really really want to get away with this, I can think of two approaches:

  1. If you can't control the images (ie. users uploads their own to a public site), you could use a server side script that slices the images according to predefined page-sizes, and then serve them as a single printable HTML document (you could even use CSS page breaks).

  2. Otherwise, if you can control the content, you may just use some graphic editing software to do the slicing. I know there are some with built-in features to export an image as an HTML document, slicing it first.
fandelost
A: 

A possible solution would be adding a print stylesheet that shrinks large images. Since this issue only affects IE, you can target the stylesheet to just those browsers with conditional comments. The example assumes you know what the oversized images are beforehand. It can easily be made dynamic to handle other situations.

In the html (this would only be seen by IE6 and lower):

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" media="print" href="print.css" />
<![endif]-->

In print.css:

img.tooLarge {
   width: 25%; 
   height: 25%;
   }
vamin
A: 

Save the image and print with Paintbrush, Windows Picture and Fax viewer, or some other program. From what I can tell, photoshop suffers from the same problem.