打印字符重叠问题

lixb 2004-11-04 12:00:21
我这里用ReportDocument的PrintToPrinter方法在激光打印机上打印好好的,但到了用户的针式打印机上就出现字符重叠了,而先前直接用CrystalReportViewer控件的PrintReport方法倒是没有问题。请各路大侠指点迷津,多谢了
...全文
278 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
OriesMap 2004-11-04
  • 打赏
  • 举报
回复
不好意思,我不是楼主,路过。

但是想问jinbingg(bing),你可以说一下用C#自己写打印程序应该多注意哪些方面,
或者提一点点思路呀?
jinbingg 2004-11-04
  • 打赏
  • 举报
回复
你用水晶报表的话就好不要再针式的打印机。。你可以用c#自己写打印程序。。打印的不会出现这种问题。我以前也遇到过和你一样的问题
39827140 2004-11-04
  • 打赏
  • 举报
回复
上面是我是一个简单的打印程序!
应该可以打出东西!
39827140 2004-11-04
  • 打赏
  • 举报
回复
private void menuItemSet_Click(object sender, System.EventArgs e)
{
statusBar1.Text="页面设置";

PageSetupDialog pageSet=new PageSetupDialog();
pageSet.Document=printDocument;
pageSet.AllowOrientation=true;
pageSet.ShowDialog();

}

private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{

float linesPerPage=0;
float yPos=0;
int count=0;
float leftMargin=e.MarginBounds.Left;
float topMargin=e.MarginBounds.Top;
string line=null;
StreamReader streamToPrint=new StreamReader(currentFileName);
SolidBrush brush=new SolidBrush(textBox1.ForeColor);
linesPerPage=e.MarginBounds.Height/textBox1.Font.GetHeight(e.Graphics);

while(count<linesPerPage&&((line=streamToPrint.ReadLine())!=null))
{
yPos=topMargin+(count*textBox1.Font.GetHeight(e.Graphics));
e.Graphics.DrawString(line,textBox1.Font,brush,leftMargin,yPos,new StringFormat());
count++;
}
if(line!=null)
{
e.HasMorePages=true;
}
else
{
e.HasMorePages=false;
}
}
39827140 2004-11-04
  • 打赏
  • 举报
回复
private void menuItemPrint_Click(object sender, System.EventArgs e)
{
statusBar1.Text="打印操作";
PrintDialog printDialog=new PrintDialog();

printDialog.Document=printDocument;

if(printDialog.ShowDialog()==DialogResult.OK)
{
try
{
printDocument.Print();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}

lixb 2004-11-04
  • 打赏
  • 举报
回复
也是,请教jinbingg(bing)如何用c#自己写打印程序?有无代码或例子?

110,536

社区成员

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

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

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