Solved

Send Print jobs through IIS

Posted on 2011-09-30
2
255 Views
Last Modified: 2012-05-12
I have a web application that prints a label to a network printer. The C# Code is simple:

                var prnDocument = new PrintDocument {PrinterSettings = {PrinterName = "Network Printer"}};
                prnDocument.PrintPage += PrintOrderLabels;
                prnDocument.Print();

private void PrintOrderLabels(object sender, PrintPageEventArgs e)
        {
 var fnt = new Font(FontFamily.GenericSerif, 10);
 float yPos = 10;
            float xPos = 25;
            e.Graphics.DrawString("Hello", fnt, Brushes.Black, xPos, yPos);
}

When I'm debugging in vs2010, i can print to the network printer all night. When I deploy my app in IIS, i cant print. I dont get an error and there is nothing in the event logs. I was using this exact same code to print to another network printer and it worked fine. I think there is a setting in IIS i havent changed in order to print to the new printer. The admin who setup the first printer is on vacation, so I dont know what he did in order to make the first printer work. Does anyone know how I can make the new printer print through IIS?
0
Comment
Question by:troycomp
2 Comments
 
LVL 18

Accepted Solution

by:
dj_alik earned 500 total points
ID: 36896027
1. setup drivers if network printer on server  and set shared name
2. set IIS pool identity to local system

 
0
 

Author Closing Comment

by:troycomp
ID: 36982291
abandoned the project
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now