Solved

Print a file in network printer

Posted on 2011-02-17
6
896 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
  • 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 14

Accepted Solution

by:
quizwedge earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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 asp.net 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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

823 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