我正在使用微软的代码模板,在这个网站上找到了它,使用以下代码片段来打印一行并换页:
string s = "Hello world!\xC"; //\xC means form feed
PrintDialog pd = new PrintDialog();
pd.PrinterSettings = new PrinterSettings();
if (DialogResult.OK == pd.ShowDialog(this))
{
RawPrinterHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName, s);
}
但是不幸的是,我的纸张长度总是像A4纸一样长。
我的代码有什么问题?有人有什么提示或技巧来解决这个问题吗?