I got this CSS
And only this HTML in the body
<img id="image" src="image.jpg"/>
*image.jpg is 8.5x11 inches itself
Went to the registry in HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\PageSetup
and set these values to zero (0):
(This last step in the registry is because I cannot put those values to 0 in the Page Setup dialog, no matter what I put I always get something greater that 0, hence a forced margin value I don't want.)
The Problem: As you see, I intent to print a full 8.5x11 inches image. In the print preview it appears fine, but when I print it, I always get white margins in the 4 borders!!!
I tried many, many different printers, even a pdf printer, always the same result.
Where do those margins come from? My CSS is pretty clear stating that the image selector is 8.5x11 inches, starting at top 0,0. I can even preview it correctly!!
And by the way, why can't I set IE margins to 0 without going to the registry?
Didn't do. I tried that but the problem seems to be with the margins in IE browser.
For instance, I can have the body of the page to show a blue background. If I open it within a browser everything looks OK, but if I go to "Print Preview" I'll get the nasty margins (white color by default so that's how I know they're not mine).
If I try to lower the margins to 0 (zero) the browser will adjust them to some number, but never zero.
The only way I can manage the print preview (and later print) to work, is setting the margins to zero in the registry in
where thse values are the none to set to zero:
I even made the page 8in times 11in (8x10) and made the sylesheet centered, but the margins are appended anyway.
This is driving me crazy
I tried to think logically - if the header/footer are set to some value (can it be a whitespace too?), the IE will reserve the place for them...
The other idea: the difference between physical paper size in the printer and your programmable page size can cause the margins (e.g. US Letter and A4).
Probably you've checked it previously, in this case I bag your pardon.
Oh, the newest idea:
Does the IE support the page settings, such as margins? If they are the feature of CSS2?
Here we have an opened question - the settings in CSS and registry together. Which one is a stronger?
I have similar problem with the page orientation (I've opened a separate thread for it)
Sorry once more:
I can't answer youe question, but make a new and new ones...
Don't worry, any ideas are welcome.
The thing is, Header and Footer I already played with, no luck ...
If you play with the 4 margin values in the registry and set them to 0, you won't get margins while printing and that's what I want.
The problem, well very simple, I cannot manipulate every user's registry form the Web, nor should I.
My goal is to provide reliable printing capabilities from my web site to IE users, but as you see, those margins are way off control.
Finally, CSS2 and IE? There's still a long way to go before you can trust CSS2 in IE. They claim to have close the gap, but if you play a while with CSS2 and IE7, you'll realize the truth.
Probably now I have an answer to your problem:
In normal case the printer settings contain a safety strip (about 5 mm) as a margin all-around the page.
It was done in order to prevent the innen parts of the printer from a dirt.
It is possible to set another value using the printer panel, for example, on Lexmark: print area -> whole page/normal.
The printer's manufacturers don't like this option...
Have a nice day (me too)....
next week I send the "instruction", today I work at home, havn't access to this printer.
Lexmark Optra K1220:
MENU --> SETUP MENU --> PRINT AREA --> Whole Page
For some kinds of printers such setting can be hidden (entering of a special sign sequence etc.)