Re: Cancel Print

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Kevin Yu [MSFT] said the following on 6/15/2006 11:10 PM:
Hi,

Yes, you can prevent the user from printing the page in script.

No, you can only try to prevent it.

To achieve this, you might be able to use the onbeforeprint method to "blank" the page before it gets passed to the printer.

Possible but easily circumvented.

Note that this can still be circumvented any number of ways, but it gives you an attempt at it.

And it still only an attempt that is not reliable.

However the user may still be able to copy and paste the content to some text editor and print. If you really want to do this, please check the following newsgroup thread, which is doing exactly the same thing as you do.

http://groups.google.com/group/microsoft.public.inetsdk.programming.scriptin
g.vbscript/browse_thread/thread/ce45c4ae0b4ceff7/8e58e6e97287341b?lnk=st&q=p
revent+print+jscript+page&rnum=19&hl=en#8e58e6e97287341b

Your posting agent is broken.

Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages