How to force the ASP page to print landscape in ASP?

Posted on 2005-04-17
Last Modified: 2008-03-17
   Anyone knows,
  How to force the ASP page to print landscape in ASP (using JavaScript / VBScript)?
  Is it possible?
Question by:Lst
    1 Comment
    LVL 49

    Accepted Solution

    Lst, printing landscape forced by Javascript or VBScript is not possible.

    As CobolDinosaur wrote in http://Q_20323599.html on using CSS for printing landscape:

    > <style>
    >   @media print{body {size:landscape; } }
    > </style>

    > Is in the CSS2 standard and I think the latest version of Opera may support it.  Other than that you will have to wait
    > for implementation by the browser manufacturers.

    As you see, CSS2 on this issue isn't widely supported and certainly not by IE.
    Therefor the options you have (again, quoting Cd&):

    > 1. Give the user instuctions on how to print the page.
    > 2. Use PDF or other printer oriented format for the page.
    > 3. redesign the page so it does not need to be printed landscape.

    > In the end it is never going to be 100% sure, because you cannot control a printer from
    > a web page, you need the user to handle it.

    Kind regards,


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now