Restricting Printing

  • Thread starter Thread starter Jason Wilson
  • Start date Start date
J

Jason Wilson

I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr> and
<Alt-PrtScr>?
 
Or disabling browser scripts....


Eliyahu Goldin said:
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr>
and <Alt-PrtScr>?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
I thought of that, but for HIPPA reasons, I have to make a reasonable
effort.

Eliyahu said:
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr> and
<Alt-PrtScr>?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
sure...is there any constructive feedback and disabling the browsers
ability to print except through my button control?

BTW - my application is designed not to run if scripting is disabled --
they'll never get to info unless thess they very very clever.

Or disabling browser scripts....


Eliyahu Goldin said:
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr>
and <Alt-PrtScr>?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
Got it. There are still ways to get around it, but I have opened the
application without the browser buttons, disabled the application is
scripting is disabled and added the current script:

<script type="text/javascript">
function preventCTLnALT(){
if(event.ctrlKey || event.altKey){
alert('Use of the control and alt keys are prohibited with this
application');
if (event.preventDefault) e.preventDefault();
if (event.returnValue) event.returnValue = false;
return false;
}
}
document.onkeydown=preventCTLnALT
</script>

This will prevent all the most common ways of printing and copying
while using my application.


Eliyahu said:
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr> and
<Alt-PrtScr>?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
Still doesn't save you from just PrtScr. Is it ok with HIPPA?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
Got it. There are still ways to get around it, but I have opened the
application without the browser buttons, disabled the application is
scripting is disabled and added the current script:

<script type="text/javascript">
function preventCTLnALT(){
if(event.ctrlKey || event.altKey){
alert('Use of the control and alt keys are prohibited with this
application');
if (event.preventDefault) e.preventDefault();
if (event.returnValue) event.returnValue = false;
return false;
}
}
document.onkeydown=preventCTLnALT
</script>

This will prevent all the most common ways of printing and copying
while using my application.


Eliyahu said:
Jason,

This is an impossible task. What about taking a screenshot with <PrtScr>
and
<Alt-PrtScr>?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]


Jason Wilson said:
I need to restrict printing to certain users and log printing within an
ASP.NET 2.0 application. Any suggestions on how to do this?

The only idea I could come up with is launch the application in a
secondary window using javascrip to keep the Print menu options from
showing and then restrict the use of CLT-P and CLT-C using javascript.
Then the only way to print would be by a button control within the
application.

I'm not really satisfied with this solution, but will use it unless
someone has a better idea.

Thanks for your help,

Jason
 
Back
Top