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
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
Question by:sp
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
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.

Author Comment

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

Accepted Solution

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() };

Author Comment

ID: 41838621
Thank you. Appreciated!
LVL 34

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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