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);
}
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);
}