PrintpreviewDialog文件无法发送打印机?

时间:2012-11-06 19:01:27

标签: c# winforms

我有一个奇怪的问题。我的打印文档出现在printprieviewdialoge中,但在点击打印图标后,我得到了打印机的空白纸张。 PrintPriviewDialoge有问题吗? 如果我在进入showdialog之前将文件发送到打印机,它可以工作,但是在showdialog不打印之后。

for (int i = 0; i < caixasFiscais.Count; i++)
{
CaixaECF caixa = new CaixaECF(loja, caixasFiscais[i], data1, data2);
posicaoDaLinha = margemSup + (linhaAtual * Convert.ToInt32(fonteNormal.GetHeight(e.Graphics)));
e.Graphics.DrawLine(new Pen(Brushes.LightSteelBlue, 30), margemEsq, posicaoDaLinha, margemDir, posicaoDaLinha);
e.Graphics.DrawString("CAIXA FISCAL " + caixa.numero, fonteNegrito, Brushes.Black, margemEsq, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("CREDITOS", fonteNegrito, Brushes.Black, margemEsq + 150, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("DEBITOS", fonteNegrito, Brushes.Black, margemEsq + 350, (posicaoDaLinha - 5.5f), new StringFormat());
e.Graphics.DrawString("GAVETA", fonteNegrito, Brushes.Black, margemEsq + 550, (posicaoDaLinha - 5.5f), new StringFormat());
linhaAtual++;}

我也尝试保存为pdf文件,但同样没有保存数据。但printpreviewdialog显示绝对好的报告。

0 个答案:

没有答案