用printdocument的print()能不能直接打印??

zhoujr 2004-07-28 09:40:58
用printdocument的print()时,是不是一定要先把待打印的内容生成pdf文件,保存后再在pdf里面打印?
能不能直接点击“打印”按钮时,就直接打印呀?
...全文
1100 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
Zoujinyucn 2005-01-14
  • 打赏
  • 举报
回复
用javascript方法好了.不过前提是ie5.5或者以上
WebBrowser.ExecWB(1,1) 打开
Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口
Web.ExecWB(4,1) 保存网页
Web.ExecWB(6,1) 打印
Web.ExecWB(7,1) 打印预览
Web.ExecWB(8,1) 打印页面设置
Web.ExecWB(10,1) 查看页面属性
Web.ExecWB(15,1) 好像是撤销,有待确认
Web.ExecWB(17,1) 全选
Web.ExecWB(22,1) 刷新
Web.ExecWB(45,1) 关闭窗体无提示
http://www.itonline.gd.cn/ittech/list.asp?id=648
nnfzj 2004-11-27
  • 打赏
  • 举报
回复
简单
长江支流 2004-08-25
  • 打赏
  • 举报
回复
使用这个开源免费的打印
http://community.csdn.net/Expert/topic/3278/3278050.xml?temp=.5012934
xiaomaoy 2004-08-19
  • 打赏
  • 举报
回复
直接打印
private void print_Click(System.Object sender, System.EventArgs e)
{
printDocument1.Print();
}
private void printDocument1_PrintPage(System.Object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
PaintEventArgs myPaintArgs = new PaintEventArgs(e.Graphics, new Rectangle(new Point(0, 0), this.Size));
this.InvokePaint(要打印的东东, myPaintArgs);
}
allanli 2004-07-30
  • 打赏
  • 举报
回复
.NET下报表打印完美解决方案

宽带访问 http://nhkh.kmip.net/index1.htm
Modem拨号 http://nhkh.kmip.net/index2.htm

做了个小调查和演示动画,希望大家提提意见啦.动画比较大,有19M,下载完的朋友也可以提供给其他人下,不要把我的机拉死了,呵呵.

http://nhkh.kmip.net/research.asp
暗石绿 2004-07-30
  • 打赏
  • 举报
回复 1
using System.Drawing.Printing;
using System.Drawing;
using System;
using System.Windows.Forms;

public class PrintingExample:System.Windows.Forms.Form
{
private Font printFont;
public PrintingExample()
{
Printing();
}
private void pd_PrintPage(object sender, PrintPageEventArgs ev)
{
string PrintText = "我的意思是能不能不保存成pdf文件,而直接打印";
ev.Graphics.DrawString(PrintText, printFont, Brushes.Black, 50, 100);

}

[STAThread]
public static void Main()
{
Application.Run(new PrintingExample());
}

public void Printing()
{
printFont = new Font("Arial", 10);
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
// Print the document.
pd.Print();

}

}
zhoujr 2004-07-28
  • 打赏
  • 举报
回复
怎么没人理我
55……
zhoujr 2004-07-28
  • 打赏
  • 举报
回复
我的意思是能不能不保存成pdf文件,而直接打印
BitNomad 2004-07-28
  • 打赏
  • 举报
回复
先要把打印的内容写到.System.Drawing.Printing.PrintPageEventArgs e 的e.Graphics里面
就可以打印了

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧