0

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

4
  • Duplicate: stackoverflow.com/questions/952607/… Commented 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. Commented 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.asp Commented Jun 7, 2012 at 14:22
  • 1
    That'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. Commented Jun 7, 2012 at 14:23

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.