IE7不打印完整图像?

时间:2022-10-30 22:23:25

i have an jpg where the height is larger than a regular 8.5x11 piece of paper (the height is around 2000px)

我有一个jpg,其高度大于普通的8.5x11张纸(高度约为2000px)

here is the link http://i39.tinypic.com/121d7ur.jpg

这是链接http://i39.tinypic.com/121d7ur.jpg

so obviously when you try to print this picture its going to print on more than 1 piece of paper ....however when i try to print the page (or even go to print preview)...it only shows half the image on the first page....but there is no second page?...there should be a second page to show the rest (or even a 3rd page)

很明显,当你试图打印这张照片时,它会在超过1张纸上打印....但是当我尝试打印页面(甚至去打印预览)时......它只显示了一半的图像第一页......但是没有第二页?...应该有第二页显示其余页面(甚至是第3页)

if i use FF there is no problem...it prints on 3 pages....but with IE 7 i'm limited to just printing 1 piece of paper.

如果我使用FF没有问题...它打印在3页....但对于IE 7我只限于打印1张纸。

i have right right clicking on the image itself within IE7 and clicking "print this image" and still no luck.

我在IE7中右键单击图像本身并单击“打印此图像”仍然没有运气。

anyone have a solution for this?

有谁有解决方案吗?

3 个解决方案

#1


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Blank XHTML 1 Transitional Page</title>
<style>
@media print {
    html { height: 100%; }
    img { height: 100%; }
}
</style>
</head>
<body>
    <img src="bigimage.jpg" />
</body>
</html>

EDIT: Sorry, didn't initially realize your image was too TALL rather than too WIDE. To reduce the image height whilst maintaining aspect ratio, use CSS to set both HTML and IMG to have a height of 100% - see modified example.

编辑:对不起,最初没有意识到你的图像太高而不是太宽。要在保持纵横比的同时降低图像高度,请使用CSS将HTML和IMG设置为100%的高度 - 请参阅修改示例。

#2


I know this probably isn't the answer you are really looking for, but if you are intending on the users printing the image, I would consider putting it into a PDF. That way it will always print the same, everytime for everyone.

我知道这可能不是您真正想要的答案,但如果您打算打印图像的用户,我会考虑将其放入PDF中。这样每次都会为每个人打印相同的内容。

#3


Try wrapping the image in a div, in the div css apply the following:

尝试将图像包装在div中,在div css中应用以下内容:

image_wrapper {*height:1%; position:relative}

The star/* selector should limit to IE, this is a variant of the holly hack.

星/ *选择器应限制为IE,这是冬青黑客的变种。

#1


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Blank XHTML 1 Transitional Page</title>
<style>
@media print {
    html { height: 100%; }
    img { height: 100%; }
}
</style>
</head>
<body>
    <img src="bigimage.jpg" />
</body>
</html>

EDIT: Sorry, didn't initially realize your image was too TALL rather than too WIDE. To reduce the image height whilst maintaining aspect ratio, use CSS to set both HTML and IMG to have a height of 100% - see modified example.

编辑:对不起,最初没有意识到你的图像太高而不是太宽。要在保持纵横比的同时降低图像高度,请使用CSS将HTML和IMG设置为100%的高度 - 请参阅修改示例。

#2


I know this probably isn't the answer you are really looking for, but if you are intending on the users printing the image, I would consider putting it into a PDF. That way it will always print the same, everytime for everyone.

我知道这可能不是您真正想要的答案,但如果您打算打印图像的用户,我会考虑将其放入PDF中。这样每次都会为每个人打印相同的内容。

#3


Try wrapping the image in a div, in the div css apply the following:

尝试将图像包装在div中,在div css中应用以下内容:

image_wrapper {*height:1%; position:relative}

The star/* selector should limit to IE, this is a variant of the holly hack.

星/ *选择器应限制为IE,这是冬青黑客的变种。