Solved

Print a file in network printer

Posted on 2011-02-17
6
909 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
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…

717 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