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
-
Duplicate: stackoverflow.com/questions/952607/…beeglebug– beeglebug2012-06-07 14:12:16 +00:00Commented Jun 7, 2012 at 14:12
-
I'd like to know what you expect to do if the printer doesn't support whole-page printing.Blazemonger– Blazemonger2012-06-07 14:13:46 +00:00Commented Jun 7, 2012 at 14:13
-
w3schools.com/css/css_mediatypes.asp you need to specify styling specifically for printing. if you are using external stylesheets (like <link rel='stylesheet' />) then you can set the media attribute to also be for printing w3schools.com/tags/tag_link.aspIan– Ian2012-06-07 14:22:02 +00:00Commented Jun 7, 2012 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– Icarus2012-06-07 14:23:33 +00:00Commented Jun 7, 2012 at 14:23
Add a comment
|
1 Answer
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.