Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 4 123 ... LastLast
Results 1 to 15 of 51
  1. #1
    New Coder
    Join Date
    May 2003
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing Without Prompt

    Hello , I rencently saw a artivle at the MS website (MSND or something). I found it using google. It described how to make IE print the page that is being vieved without prompting and asking what printer , but just use the default printer. Now , my question is , how can , if a visitor clicks a link , a page be printed directly (without prompt)?

    Xanni

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    maybe this will help you a little

    http://www.w3.org/TR/REC-CSS2/media.html
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New Coder
    Join Date
    May 2003
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that page is about defining how a page will look on different types of media (screen , paper etc.) , not about how I can make a link to let my visitors print a page without prompt... Thanks anyway.

    Xanni

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I notice that the ability to print without a user prompt was just submitted as a bug to the BUGTRAQ mailing list so anyone who's counting on this non-standard behavior will be in trouble once MS finally fixes it.

    Also because it's a bug and not a feature, I don't believe that encouraging it's use is a good thing.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #6
    New Coder
    Join Date
    May 2003
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok. I will forget the without prompt idea , can anyone tell me how to let a user print a page by clicking on a link?

    Xanni

  • #7
    New Coder
    Join Date
    Jul 2003
    Location
    england
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep just insert the code below m8:

    Code:
    <a href="javascript:window.print()">Click Here</a>

  • #8
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    ...and don't forget that print() function works for IE only
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #9
    New Coder
    Join Date
    May 2003
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay , is there such an option for Opera to?

    Xanni

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Quote Originally Posted by Kor
    ...and don't forget that print() function works for IE only
    No. It works in IE5+, NS4, NS6+, Moz. Don't know with Opera. To test if a browser supports window.print(), try:

    alert(window.print)

    if the message says "undefined", it means not supported.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #11
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    glenngv is right, sorry... works also on ns7 and last mozilla or gecko browsers... I was confounded it with something else, probably... sorry again to all
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by xhispage
    ok. I will forget the without prompt idea , can anyone tell me how to let a user print a page by clicking on a link?

    Xanni
    That's a wise decision, if you provide it now using the "hack" and later when it's fixed your users will howl. But if you don't provide it now, you users won't have time to get used to the "convenience" and therefore won't come back complaining once it's no longer usable.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure where i got this so sorry if i got it from u..

    <script>
    function Print() {
    alert ("THUD.. another tree bites the dust!")
    if (document.layers)
    {
    window.print();
    }
    else if (document.all)
    {
    WebBrowser1.ExecWB(6, 1)//use 6, 1 to prompt the print dialog or 6, 6 to omit it
    ;
    WebBrowser1.outerHTML = "";
    }
    }
    </script>
    <object ID="WebBrowser1" WIDTH="0" HEIGHT="0"
    CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
    </object>

    using (6,6) worked fine for me under IE5.5
    hope this is helpful if not belated
    ez
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.

  • #14
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,243
    Thanks
    203
    Thanked 2,555 Times in 2,533 Posts
    If this causes a page to be printed without the consent of the user or without prompting then it is a practice which I find wholly unacceptable.

    It would be another site which I would never dream of visiting again.

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    Australia
    Posts
    197
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey fine by me,

    Basically the users appreciate that they dont have to click ok to a print prompt 20 times to print off the 20 images i collect for them on my page.
    They just get the pages they ask for
    incidentally if you use 8,1 it will pop up the print setup dialog box..
    1,1 is file open
    4,1 is save page
    6,1 is print and prompt user
    7,1 print preview

    thats as far as i have investigated.

    Obviously people should always use things responsibly and be mindful of the users needs.

    generally i run the 7,1 print preview first .. that sets up the page
    (you would need to do this for any new window you open as well)

    Then you could do a 6,1 or 6,2 depending on the users preferences
    hey you can even make it user selectable like i have
    by the way if you want to reuse the object get rid of the outHTML line..

    Overall comment is that
    I am a responsible designer
    this information has genearlly been buried and hard to find but it is out there
    so if some spam-head or malicious user wants to exploit this stuff they can
    and this forum wont be the first place they find it..
    for example
    6, -1 is a very long known and obvious security hole (among thousands of others) every malicious user on the planet knows about them..

    but this post is in the interests of RESPONSIBLE 'how to'
    do something that you really need to do...

    I was in a bind and it was the solution i really needed, i am sure there are others who can use this responsibly and there wont be fewer or more
    malicous users because of this post..

    It just adds further to a post i FOUND on wsabstract or DD..hmmm cant really remember which..

    Cheers
    ez
    Animation Rule #64
    Poor quality images are often artistic,
    Poor quality sound is ALWAYS annoying.


  •  
    Page 1 of 4 123 ... LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •