Restricting Printing

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
 
E

Eliyahu Goldin

Jason,

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

Mike

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
 
J

Jason Wilson

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
 
J

Jason Wilson

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
 
J

Jason Wilson

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
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top