?
Solved

Print a file in network printer

Posted on 2011-02-17
6
Medium Priority
?
920 Views
Last Modified: 2012-05-11
Hello,
I have to print files from my .net program to a network printer. Please see attachment for printer settings.

1. I know file path of the file to print
2. I know printer uri as you can see in the attachment
3. The printers are in the network and are not installed on the machine I want to print from

I am investigating ways to print files on a network printer using a .net program (asp.net). Please point me in right direction printer sample settings
0
Comment
Question by:kolakanuru1
[X]
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
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:quizwedge
ID: 34922157
Check out http://aspalliance.com/462_Printing_an_ASPNET_Web_Form_When_It_Is_Submitted.all I haven't walked through the code, but they claim to have the code to do what you want to do.

If that doesn't work, you could try using classic ASP as shown at http://www.asp101.com/articles/john/serversideprint/network.asp

If neither of those work, you could save the link for the page to a database and then have a Windows Service on the server that continually loops looking for pages it needs to print and have the Windows service handle the printing.
0
 
LVL 3

Author Comment

by:kolakanuru1
ID: 34927104
I went through the articles. They are not related my question.

I know how to print from my asp.net application if the printer is attached to the server hosting the application.

What I am looking for is to print a file from my asp.net application to a printer which is in network but  not installed on the server. I know printer URI. May be a binary dump of the file to the printer using its URI or some thing.

Besically, our organisation has lot of users. They have to print documents in printers close to them. It is not practical to install each and every printer on the server. The printers are attached to a print server and are given a URI.
0
 
LVL 3

Author Comment

by:kolakanuru1
ID: 34927702
One more thing is , since the printer is ipp printer, is there anyway that I can print using IPP from my asp.net
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 14

Accepted Solution

by:
quizwedge earned 2000 total points
ID: 34930522
Sorry, I misunderstood. I thought that the printers were not installed on the users' machines, but they were on the server. I haven't worked with IPP before, but here's my best suggestion:

For the first half of the solution, have the ASP.NET app save a link to the page or the documents that you want to print along with URI for the printer.

For the second half, have a Windows service on the server that continually polls for documents to print. It can then add the printer on the fly using code from http://www.marcusnyberg.com/2010/11/17/how-to-install-a-network-printer-with-vb-net-and-wmi/

To prevent having tons of printers added to the server you could either search for the printer before adding it (modify the code at set the default printer at http://msdn.microsoft.com/en-us/library/aa394598(v=VS.85).aspx) or you could remove the printer after you've printed. I found some code for deleting (and actually adding as well) at http://binaryworld.net/Main/CodeDetail.aspx?CodeId=3646 but it only seems to be coming up in the Google Cache. The information talks about Windows 95 and Windows NT so it might be dated and no longer work. I also found information on deleting the printer at http://www.vbforums.com/showthread.php?t=331445&highlight=remove+printer The person had an issue with their code, but was able to resolve it. Unfortunately, they didn't post what their solution was other than a vague description.

Hope that helps... I'm not sure if you can print directly from ASP.NET without installing a printer and I'm also not sure if you can install a printer from ASP.NET. Even if you could, I'd worry about timeouts or the user leaving the page.

Hope that helps. Let me know if I can be of any other assistance.
0
 
LVL 3

Author Comment

by:kolakanuru1
ID: 34963920
quizwedge,
I would like installing printers on the server as the last option. How ever, thank you for your insights, they certainly opened up different avenues. Appreciate your suggestions.
0
 
LVL 3

Author Closing Comment

by:kolakanuru1
ID: 34963938
This is not a solution to my question.But, the comments by the expert are useful.
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 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