Change page margin from Javascript Print

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikramrkin
    New Member
    • Nov 2008
    • 2

    Change page margin from Javascript Print

    Hi,

    I want to alter the browser page margin (in IE) before printing a page using Javascript. Is there a way of doing it?

    This seems like an internal detail of IE and I am not sure if this can be done.

    Thanks
    Vikram
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Not with JavaScript, but if it's for a controlled user base, you could use a browser-specific solution, e.g. ActiveX for IE.

    Comment

    • rnd me
      Recognized Expert Contributor
      • Jun 2007
      • 427

      #3
      just add a print media stylesheet that over-rides the margins.

      javascript could be used to do this, but making a print stylesheet is simpler and doesn't have to rely upon javascript.

      Comment

      • vikramrkin
        New Member
        • Nov 2008
        • 2

        #4
        Hi rnd me,

        I did some reading on printer friendly CSS and found that it can not control the margin set in browser. Please let me know if I am missing something.

        I guess the only option I have is to develop an activeX component.

        Thanks,
        Vikram

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Yes, margins are outside the control of the CSS page box.

          If this is for IE only, there's an ActiveX control by Meadroid - ScriptX (free version) that should be good enough for your requirements.

          Comment

          Working...