最近我有一个项目教育管理系统是在Windows应用程序中使用C#.net在我使用打印文档控制打印标记工作表布局和它的工作好..但我必须在Asp.net网站上进行转换因此,任何打印方法打印标记工作表布局与打印文档和标记内容相同的质量工作表从数据库抓取。 任何代码都可以帮助您在C#中完全打印Java脚本。有关打印,但打印质量的任何代码是必要的,因为标记页打印用C#打印Asp.Net
我有代码的窗口appilcation相关的代码,但我想基于Web的解决方案
private void printDocument2_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawRectangle(Pens.Black, rectangleShape1.Location.X, rectangleShape1.Location.Y, rectangleShape1.Width, rectangleShape1.Height);
//////////////////////////////
e.Graphics.DrawString(label24.Text, label24.Font, Brushes.DarkBlue, label24.Location.X, label24.Location.Y);
e.Graphics.DrawString(label25.Text, label25.Font, Brushes.DarkBlue, label25.Location.X, label25.Location.Y);
e.Graphics.DrawString(label26.Text, label26.Font, Brushes.Brown, label26.Location.X, label26.Location.Y);
e.Graphics.DrawString(label27.Text, label27.Font, Brushes.Black , label27.Location.X, label27.Location.Y);
e.Graphics.DrawString(label28.Text, label28.Font, Brushes.Black, label28.Location.X, label28.Location.Y);
e.Graphics.DrawString(label29.Text, label29.Font, Brushes.Black, label29.Location.X, label29.Location.Y);
e.Graphics.DrawString(label30.Text, label30.Font, Brushes.Black, label30.Location.X, label30.Location.Y);
e.Graphics.DrawString(label31.Text, label31.Font, Brushes.Black, label31.Location.X, label31.Location.Y);
////////////////////////////
e.Graphics.DrawString(txtRollno.Text, txtRollno.Font, Brushes.Black, txtRollno.Location.X, txtRollno.Location.Y);
e.Graphics.DrawString(txtName.Text, txtName.Font, Brushes.Black, txtName.Location.X, txtName.Location.Y);
e.Graphics.DrawString(txtfathernameid.Text, txtfathernameid.Font, Brushes.Black, txtfathernameid.Location.X, txtfathernameid.Location.Y);
e.Graphics.DrawString(txtAddress.Text, txtAddress.Font, Brushes.Black, txtAddress.Location.X, txtAddress.Location.Y);
e.Graphics.DrawString(txtContact.Text, txtContact.Font, Brushes.Black, txtContact.Location.X, txtContact.Location.Y);
////////////////
e.Graphics.DrawImage(pictureBox1.Image, pictureBox1.Location.X, pictureBox1.Location.Y, pictureBox1.Width, pictureBox1.Height);
}
private void btnPrintPreview2_Click(object sender, EventArgs e)
{
printPreviewDialog1.Document = printDocument2;
printPreviewDialog1.Show Dialog();
}
感谢您的答复,但我听比我们还可以通过Java脚本打印的HTML页面,以便打印任何Java代码,纸条是 –
你可以打印HTML,它很简单,只需调用window.print(),http://www.w3schools.com/jsref/met_win_print.asp。为了获得更好的效果,您可能需要为打印介质创建一个单独的CSS样式表。 –