gpt4 book ai didi

c# - 无法停止打印

转载 作者:太空狗 更新时间:2023-10-29 23:17:00 24 4
gpt4 key购买 nike

<分区>

我使用 this device 打印条形码,但打印机不停止打印,给我空标签,直到我将其关闭。我找到了 this question,但指定纸张大小对我没有帮助。

我使用的代码:

PrintDocument document = new PrintDocument();
document.DefaultPageSettings.PaperSize =
new PaperSize("Custom", Centimeters(7), Centimeters(5));
document.PrintPage += (s, a) =>
{
a.Graphics.DrawString("*123456*",
BarcodeFont,
new SolidBrush(Color.Black),
new Point(0, 0));
}
document.Print();

厘米法:

// Converts the unit "Hundredths of an inch" to centimeter.
int Centimeters(int centimeters)
{
return (int)((centimeters * 100) / 2.54);
}

它正确地将条形码打印到第一个标签,但它不会停止。标签为 7x5 厘米。并据此设置纸张尺寸,我不知道还能做什么。

编辑:将 HasMorePages 设置为 false 没有帮助,我知道这不是因为我使用的设备:我目前使用其他一些程序来打印条形码,它们都可以工作。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com