Open mohitkokwani opened 2 years ago
@KevinGong2013 @Mauricevb @chibombo @pylearndl Please give some suggestions!
Any guidance will be appreciated ! Thank you.
@mohitkokwani has you found a solution?
@mohitkokwani has you found a solution?
No Not YET! waiting for guidance of the @KevinGong2013 @Mauricevb @chibombo @pylearndl
Can Someone please tell me why this is happening ?
Like the image starts printing but the after printing the half image the thermal printer switches off (power off) automatically!
@mohitkokwani Can you share your code with me? I can't even get the image to print. Text prints normally, but image doesn't even want to print.
guard let image = UIImage(named: "demo") else {
return
}
let width = 512
let rotatedImage = image.rotate(radians: .pi/2)
guard let printImage = rotatedImage.resizeWithWidth(width: CGFloat(width)) else{
return
}
self.imageView.image = printImage
var ticket = Ticket(
.title(" Width = \(width)"),
.image(printImage, attributes: .alignment(.center))
)
ticket.feedLinesOnHead = 2
ticket.feedLinesOnTail = 3
if bluetoothPrinterManager.canPrint {
bluetoothPrinterManager.print(ticket)
}
dummyPrinter.print(ticket)
}
extension UIImage { func rotate(radians: CGFloat) -> UIImage { let rotatedSize = CGRect(origin: .zero, size: size) .applying(CGAffineTransform(rotationAngle: CGFloat(radians))) .integral.size UIGraphicsBeginImageContext(rotatedSize) if let context = UIGraphicsGetCurrentContext() { let origin = CGPoint(x: rotatedSize.width / 2.0, y: rotatedSize.height / 2.0) context.translateBy(x: origin.x, y: origin.y) context.rotate(by: radians) draw(in: CGRect(x: -origin.y, y: -origin.x, width: size.width, height: size.height)) let rotatedImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()
return rotatedImage ?? self
}
return self
}
func resizeWithWidth(width: CGFloat) -> UIImage? { let imageView = UIImageView(frame: CGRect(origin: .zero, size: CGSize(width: width, height: CGFloat(ceil(width / size.width * size.height))))) imageView.contentMode = .scaleAspectFit imageView.image = self UIGraphicsBeginImageContextWithOptions(imageView.bounds.size, false, scale) guard let context = UIGraphicsGetCurrentContext() else { return nil } imageView.layer.render( in: context) guard let result = UIGraphicsGetImageFromCurrentImageContext() else { return nil } UIGraphicsEndImageContext() return result } }
@mohitkokwani The Leopard A8 printer prints correctly. The Leopardo A7 Light printer does not print. I tried to change the width but it still won't work. Any idea what it could be?
@mohitkokwani The Leopard A8 printer prints correctly. The Leopardo A7 Light printer does not print. I tried to change the width but it still won't work. Any idea what it could be?
Same Problem is here my printer is MPT-III thermal printer in which my image is not printing full after printing half image the printer stops and power off automatically i don't understand what could be the problem @chibombo Help Us.
Before print your image use this my function to resize correctly the image This function prevent also "index Out of range"
`func resizeImage(image: UIImage, newWidth: CGFloat) -> UIImage { let widthConverted = round(newWidth / 8) 8 let scale = widthConverted / image.size.width let newHeight = image.size.height scale UIGraphicsBeginImageContext(CGSize(width: widthConverted, height: newHeight)) image.draw(in: CGRect(x: 0, y: 0, width: widthConverted, height: newHeight)) let newImage = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext()
return newImage ?? UIImage()
}`
Because this: let widthBytes = (width + 7) / 8.
This is a bug.
Printer
has been rewrite.
let receipt = Receipt(.🖨️58(.ascii))
<<~ .style(.initialize)
<<< Image(cgImage, mode: .doubleWH)
<<~ .page(.print)
I'm unable to print the following image:
Using:
guard let image = UIImage(named: "hello"), let cgImage = image.cgImage else {
return
}
let receipt = Receipt(.🖨️58(.ascii))
<<~ .style(.initialize)
<<< Image(cgImage, mode: .doubleWH)
<<~ .page(.print)
if bluetoothPrinterManager.canPrint {
bluetoothPrinterManager.write(Data(receipt.data))
}
It's printing empty lines.
let dummyPrinter = DummyPrinter()
dummyPrinter.write(Data(receipt.data))
please paste this👆 output.
The output I get:
"G0AddjADLQDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABtKAA=="
That's A lot of A's 😅
Hi @Mauricevb , I have the same issue, did you solve it?
Hi, i am using the MPT-III thermal printer and i have used your library into one of my projects to print the image
what i know so far is : -Printer will print the image only if the image width is divisible by 8
What i am doing : Actually i have to print the pdf through thermal printer so what i am doing is converting the pdf into image and i have the image of with : 544 Height and 3434 width
Well i need the image vertically so i am rotating the image with 90 degree through that i am getting a new image of 3434 Height and 544 Width
So when i m trying to print the image using ticket the image is perfectly fine but after printing the half image or 1/4 of image the printer stops printing the image can anyone please help me Thanks a lot in advance.
Also one more thing when i m trying to print the same image with 264 Height and 1575 Width the full image is printing but it looks small
Anyone who finds the solution please let me know : Thank you!