How to print from the server?

  • Thread starter Thread starter Kyle
  • Start date Start date
K

Kyle

I want users to be able to select a picture on an ASP.NET
webform and have the picture print from one of the
server's printers that is installed in windows. I used
code that worked in a windows standalone app and it gave
no error, but did not print either. How should I go about
setting this up?
Here is my code I have tried:
private void buttonPrint_Click(object sender,
System.EventArgs e) {
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler
(this.pd_PrintPage);
pd.Print();
}
private void pd_PrintPage(object sender,
PrintPageEventArgs e) {
Font drawFont = new Font("Arial", 16);
SolidBrush drawBrush = new SolidBrush
(Color.Black);
PointF drawPoint = new PointF(150.0F, 150.0F);
e.Graphics.DrawString("Hello World", drawFont,
drawBrush, drawPoint);
}
 
The printers are installed per user. So different user can have different
printer settings.
IIS is running under different account (user) so it doe not have a default
printer set.

You will need to look up an KB article on how to set up a printer for IIS
service.


George.
 
Are we to assume that the users are at least in the same building as the web
server here? They would have to be in order to fetch the pictures that the
server prints out.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Yes, the targeted user will be right next to the printer.
All the other users will be submitting the jobs not
caring to pick up the print jobs.
 
Back
Top