我想打印收据图片。我在某种程度上是成功的。我正在使用Epson的ePOS SDK进行打印。以下是打印图像的代码
//create builder
EposBuilder *builder = [[[EposBuilder alloc] initWithPrinterModel:printername_ Lang:language_] autorelease];
if(builder == nil){
return;
}
//add command
int result = [builder addImage:selectImage_ X:0 Y:0 Width:MIN(IMAGE_WIDTH_MAX, selectImage_.size.width) Height:selectImage_.size.height Color:EPOS_OC_COLOR_1 Mode:[self getBuilderMode] Halftone:[self getBuilderHalftone] Brightness:[self getBuilderBrightness]];
result = [builder addCut:EPOS_OC_CUT_NO_FEED];
if(result != EPOS_OC_SUCCESS){
[ShowMsg showExceptionEpos:result method:@"addImage"];
return;
}
else{
[ShowMsg showExceptionEpos:result method:@"statusmsg_status"];
}
//send builder data
unsigned long status = 0;
unsigned long battery = 0;
result = [printer_ sendData:builder Timeout:SEND_TIMEOUT Status:&status Battery:&battery];
[builder clearCommandBuffer];
我可以打印出来,
答案 0 :(得分:0)
使用热敏打印机打印数据时遇到了同样的问题。 您应该使用HTML Formate来提高打印效果。 按照步骤进行操作。
它会帮助你。 感谢