我使用Epson的ePOS SDK,它允許通過wifi連接到打印機(TM-T88V)。鏈接爲sdk(http://pos.epson.com/mobilesdks/index.htm)使用ePOS SDK打印UIImage
我正在使用此代碼從URL加載UIImage。
NSData* data = [[NSData alloc] initWithContentsOfUrl:_url];
UIImage* image = [UIImage imageWithData:data];
然後打印圖像(使用EPOS)注:我將跳過連接的部分,因爲它不包括我的問題。
EposBuilder* builder = [EposBuilder alloc] initWithPrinterModel:@"TM-T88V" lang:EPOS_OC_MODEL_ANK];
EposPrint* printer = [[EposPrint alloc] init];
int retVal = EPOS_OC_SUCCESS;
unsigned long status = 0;
retVal = [builder addImage:image X:0 Y:0 Width:image.size.width Height:image.size.Height Color: EPOS_OC_COLOR_1];
retVal = [printer sendData:builder Timeout:10000 Status:&status];
現在我的問題是,打印的結果是小了很多,看到圖像的大小爲271x368px。請參閱下面的圖像樣本
有關如何使其正確打印的任何想法?我也發現這個Printing UIImage using AirPrint causes cut-off content它給了一個縮放圖像的鏈接,但它不起作用。有任何想法嗎?謝謝。
任何人對此有一個解決方案嗎? – Iya 2016-03-04 07:50:16
我建議你根據紙張尺寸 – 2017-12-22 11:15:38