• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 47
  • Last Modified:

how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET

how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET
0
sp
Asked:
sp
  • 3
  • 2
1 Solution
 
Paul MacDonaldDirector, Information SystemsCommented:
Can't be done, as far as I know.  This would be a huge security failure.
0
 
sp.NET DeveloperAuthor Commented:
Could you please elaborate regarding security failure? or please provide alternate solution.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Imagine anyone on any web site being able to force your printer to print something without your intervention.  Huge.  Security.  Failure.

The alternative solution is to bring up the printer dialog via one means or another, often by using the javascript window.print() command.  If you just want to pop the dialog up once the page is loaded you could do something like...

<script language=JavaScript>
window.onload = function () { window.print() };
</script>
0
 
sp.NET DeveloperAuthor Commented:
Thank you. Appreciated!
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Closing because the OP didn't and I was prompted to do it for him.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now