I use windows.print()
in my project for printing a page. I use Css to styles this page for removing body margins and padding. but Browsers like IE have default margins in Print Setup. How Can I remove all these margins? I want use whole page for printing
Asked
Active
Viewed 700 times
0

ArMaN
- 2,306
- 4
- 33
- 55
-
Duplicate: http://stackoverflow.com/questions/952607/how-to-set-margins-0-on-print-preview – beeglebug Jun 07 '12 at 14:12
-
I'd like to know what you expect to do if the printer doesn't support whole-page printing. – Blazemonger Jun 07 '12 at 14:13
-
http://www.w3schools.com/css/css_mediatypes.asp you need to specify styling specifically for printing. if you are using external stylesheets (like ) then you can set the media attribute to also be for printing http://www.w3schools.com/tags/tag_link.asp – Ian Jun 07 '12 at 14:22
-
1That's a printer setting which you cannot (it's impossible) control via Javascript. These sort of settings need to be changed either manually by the user or embedding some sort of ActiveX control with permissions to change them. – Icarus Jun 07 '12 at 14:23
1 Answers
2
I don't think you can without some kind of ActiveX deal. I tried the same thing a while back, and it wasn't possible because those settings can only be changed from the user's computer, which a webpage script doesn't have access to. The only alternative I can think of is to generate a PDF using TCPDF or something; that way you can get it to print exactly as you want it.

David John Welsh
- 1,564
- 1
- 14
- 23