gpt4 book ai didi

ios - 获取 Zebra 打印机标签的宽度(以点为单位)?

转载 作者:行者123 更新时间:2023-11-28 21:30:18 24 4
gpt4 key购买 nike

如何获得 Zebra 打印机标签的宽度(以点为单位)?

I see that PrinterStatus contains this property :

- (NSInteger) labelLengthInDots

描述如下:

The length of the label in dots. For CPCL printers this is always 0.

它非常适合查找以点为单位的标签长度​​,但我还需要以点为单位的标签宽度。是否可以获得以点为单位的标签宽度?

最佳答案

这将以点为单位返回标签的打印宽度:

NSError *getError;
NSString *width = [SGD GET:@"ezpl.print_width" withPrinterConnection:printerConnection error:&getError];

enter image description here默认情况下,这是打印机头的宽度。要计算出以点为单位的标签宽度,您需要将其以英寸为单位的尺寸乘以打印机的 dpi。我的打印机是 230 dpi,带有 3 英寸宽的标签,所以它的宽度(以点为单位)是 690。

我需要使用 SGD SET 将我的 print_width 设置为 690。

[SGD SET:@"ezpl.print_width" withValueAsInt:690 andWithPrinterConnection:connection error:error];

关于ios - 获取 Zebra 打印机标签的宽度(以点为单位)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36380411/

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