Printing

Discussion in 'ASP .Net' started by Mark S., Aug 3, 2003.

  1. Mark S.

    Mark S. Guest

    Hello everyone.
    I have this web site created in vb.net. I'm using this simple javascript
    to print

    function Printit()
    {
    window.print();
    }

    Now is there anyway in that function to automaticly select the default
    printer, set the margins and make sure printing background colors is on. oh
    and hide the image that you click on to print the page

    Thanks
    Mark
     
    Mark S., Aug 3, 2003
    #1
    1. Advertising

  2. Mark S.

    Jerry III Guest

    Hiding an image is fairly simple - just set it's display (or visibility)
    style for print @media rule. Like this:

    <html>
    <head>
    <title>Print page</title>
    <style type="text/css>
    @media print {
    #printbtn { visibility: hidden; }
    }
    </style>
    </head>
    <body>
    <a href="javascript:window.print()" id="printbtn">Print</a>
    </body>

    As for selecting the default printer and all the other stuff: No. ASP pages
    are not WinForms applications (no matter how much certain ppl want them to
    be) and there are things you just can't do. Unless you do want to install an
    actual application on the client side, such as an ActiveX control that will
    do the printing for you (but then you can't simply use window.print() but
    you'd have to do the printing yourself).

    Jerry

    "Mark S." <> wrote in message
    news:...
    > Hello everyone.
    > I have this web site created in vb.net. I'm using this simple

    javascript
    > to print
    >
    > function Printit()
    > {
    > window.print();
    > }
    >
    > Now is there anyway in that function to automaticly select the default
    > printer, set the margins and make sure printing background colors is on.

    oh
    > and hide the image that you click on to print the page
    >
    > Thanks
    > Mark
    >
    >
     
    Jerry III, Aug 3, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon B
    Replies:
    7
    Views:
    7,586
    =?Utf-8?B?SmFzb25DaG9p?=
    Jan 30, 2006
  2. JustSomeGuy
    Replies:
    13
    Views:
    522
    msalters
    Dec 9, 2004
  3. iffy agbim
    Replies:
    1
    Views:
    123
    Mark Andrews
    May 24, 2004
  4. iffy agbim
    Replies:
    0
    Views:
    123
    iffy agbim
    May 21, 2004
Loading...

Share This Page