Solved

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

Posted on 2016-10-10
5
21 Views
Last Modified: 2016-10-31
how to send content of a text file directly to the default printer not showing the print dialog using ASP.NET
0
Comment
Question by:sp
  • 3
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 41837015
Can't be done, as far as I know.  This would be a huge security failure.
0
 

Author Comment

by:sp
ID: 41838544
Could you please elaborate regarding security failure? or please provide alternate solution.
0
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points (awarded by participants)
ID: 41838617
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
 

Author Comment

by:sp
ID: 41838621
Thank you. Appreciated!
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 41866591
Closing because the OP didn't and I was prompted to do it for him.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question