Printing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark S.

    #1

    Printing

    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

    #2
    Re: Printing

    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="javascrip t:window.print( )" id="printbtn">P rint</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." <TechAge@cableo ne.net> wrote in message
    news:OsnSYufWDH A.1384@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hello everyone.
    > I have this web site created in vb.net. I'm using this simple[/color]
    javascript[color=blue]
    > 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.[/color]
    oh[color=blue]
    > and hide the image that you click on to print the page
    >
    > Thanks
    > Mark
    >
    >[/color]


    Comment

    Working...