c# - 从 C# 打印标签 - 文档尺寸对于打印机来说太大

标签 c# printing

我正在开发一个必须打印标签的应用程序。我使用的标签打印机是 Brother QL-570。标签宽度为 66mm,标签长度需要约为 45mm。我遇到的问题是我无法配置应用程序来实际打印标签。每次我这样做时,我都会收到一条警告,指出文档尺寸对于打印机来说太大了。无论我尝试将 PrintDocument 大小更改为什么尺寸,我总是会收到一条警告,指出该文档为 90mm x 29mm,对于标签打印机来说太大了。

这只是我的尝试之一:

private PrintDocument label;


label = new PrintDocument();
PaperSize pS = new PaperSize("Custom Size", 212, 67);
label.DefaultPageSettings.PaperSize = pS;
label.PrinterSettings.PrinterName = "Brother QL-570";
label.PrinterSettings.DefaultPageSettings.PaperSize = pS;
label.PrintPage += new PrintPageEventHandler(label_PrintPage);

private void label_PrintPage(object sender, PrintPageEventArgs e)
{

    SolidBrush brush = new SolidBrush(Color.Black);
    Font header = new Font(FontFamily.GenericSansSerif, 12.0F, FontStyle.Bold);

    e.Graphics.DrawString("Hello World", header, brush, 30, 30);

}

有人知道我哪里出错了吗?我想我可能没有正确设置文档和打印机的纸张尺寸。我已经尝试了许多其他纸张尺寸但无济于事。

感谢您的帮助。

最佳答案

问题不是编程问题,而是打印机配置问题。默认情况下,打印机配置为使用与我使用的纸张尺寸不同的纸张尺寸。感谢您的帮助。

关于c# - 从 C# 打印标签 - 文档尺寸对于打印机来说太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11778014/

相关文章:

javascript - 图像按钮 - 从我的网页打印文档

javascript - JS : datatables printing and exporting excel

c# - C 中的地理编码查找

java - 打印数组/反转数组

c# - 多个生产者单个消费者锁定模式

c# - 当我回发到 Controller 时,模型的所有值均为空

c++ - 使用复印功能打印设置

python - 打印列表列表,不带括号

c# - 将自定义 View 对象从 Controller 传递到 View

c# - 提取数据库特定 id :s with the repository pattern?