• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

disabling of Internet Browser options

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I need to disable the option like CTRL+P from my Internet Browser like when the user goes to File menu on Internet Browser and clicks on Print , the action print shud not take place...This thing using java how can we do...
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This thing using java how can we do


We can't. You might be able to do this with JavaScript, but the user might disable JavaScript.

A general rule of thumb is if you application requires you break the normal operation of another application, you should possibly rethink how your application works. I tend not to visit sites again if they use scripts to change the behaviour of my browser.
[ October 17, 2006: Message edited by: Paul Sturrock ]
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:
I tend not to visit sites again if they use scripts to change the behaviour of my browser.



True, if you deviate from the standard flow of operation, user will not be happy.

Think about other options rather then disabling CTL + P � you can display message on the page prompting user that do not use Print option of the browser.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
More interesting is the question: why do you want do disable printing anyway?
 
Avinash Tiwari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason for disabling the Browser option is because lets suppose the browser is displaying some confidential information and the user wants that information on screen but not on paper or print..For eg his signature....Thats why the need is to display the information with every control of browser enabled but restricting the use of any control which might put the information on paper...
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chapree Mamoo:
The reason for disabling the Browser option is because lets suppose the browser is displaying some confidential information and the user wants that information on screen but not on paper or print..For eg his signature....Thats why the need is to display the information with every control of browser enabled but restricting the use of any control which might put the information on paper...



There are many ways to take a print of a webpage

(1)File --> Print
(2)Control + P
(3)Print Button on Toolbar
(4)Right Click --> Print
(5)Print Screen --> Paste in Paint --> Print
(6)Use HttpClient to make request and print the response
(7)��

How will to stop user from doing this?
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is an unmeetable requirement. Suppose my browser told me that I could not print a document and I really wanted to print it its easy to get round my browser trying to stop me. I could turn off JavaScript (assuming the JavaScript is used to prevent printing). I could download the page and open it in some other application. I could view the source and print that etc.


Think about other options rather then disabling CTL + P � you can display message on the page prompting user that do not use Print option of the browser.


True Chetan Parekh. Maybe its just me but when sites do this sort of thing I tend not to visit them twice.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:

True Chetan Parekh. Maybe its just me but when sites do this sort of thing I tend not to visit them twice.



You can't make all the people all the time happy.
 
Avinash Tiwari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lets suppose what's desired is something like this :
The signature is in image format and the need is , not in any case let that image appear on print/paper/file.
But the pop-up messages saying Print is an invalid option are not to be used....
Then we will have to restrict the options through coding..How will we go about in this case then....
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It can't be done. If you make the image publically available it is printable. You can make it difficult to print by trying to break the printing funtionality available in a browser (though as I've pointed out, this won't stop them using an application other than a browser to print the image). If the user is determined enough they will be able to print the image. It does beg the question, if the image is sensitive, why is it being amde publically available at all?
 
Avinash Tiwari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lets say the image is a digital signature..which is required for entering into certain application...but is not required to be printed for security/hacking purposes....
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyway, this has nothing at all to do with Java. I'm moving it to "HTML and JavaScript", where they will tell you the same stuff.
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only way to keep it from being printed is to never send it to the browser.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Chapree Mamoo:
The reason for disabling the Browser option is because lets suppose the browser is displaying some confidential information and the user wants that information on screen but not on paper or print..For eg his signature....Thats why the need is to display the information with every control of browser enabled but restricting the use of any control which might put the information on paper...



Put this information in an unique styled block, for example: class="confidential" and add this to the css:



Then this field will be removed from the view to print. Or, if you don't want to shuffle the layout, then use {visibility: hidden;}


Oh, this doesn't prevent the user from hitting PrintScr, pasting it in a graphic editor and printing it as an image ...
[ October 17, 2006: Message edited by: Bauke Scholtz ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic