Solved

Print a file in network printer

Posted on 2011-02-17
6
899 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Technology Partners: 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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
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…

726 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