Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to print QR code on receipt but it gives an error
Printing of text works fine but unable to print the bitmap image or bitmap memory.



It throws an error when i use

1. PrintBitmap



printer.PrintBitmap(PrinterStation.Receipt, filePath, PosPrinter.PrinterBitmapAsIs, PosPrinter.PrinterBitmapCenter);







"Method PrintBitmap threw an exception. The device cannot perform the requested procedure."



2. PrintMemoryBitmap



System.Drawing.Bitmap bm = QRGen(text);





printer.PrintMemoryBitmap(PrinterStation.Receipt, bm, PosPrinter.PrinterBitmapAsIs, PosPrinter.PrinterBitmapCenter);



"Method PrintMemoryBitmap threw an exception. The Control cannot communicate with the Service Object. Most likely, a setup or configuration error must be corrected."
Posted
Comments
Member 10222896 28-Nov-13 6:35am    
Please anybody who can help me on this?
Marc Gabrie 29-Nov-13 12:29pm    
What class are you using there? There's an obj called "printer" you have in your code... what is that? an external library? elaborate a bit.
Michael Wicki 22-Mar-15 17:59pm    
It is POS for .NET as is remarked in the Subject ;)

Go for normal printing but in this you need to specify the length and width of the material on which you are going to print your QRCode. This setting you will find in the printer setting of that particular printer.

Best of luck
 
Share this answer
 
Hello,

May you better use the given PrintBarCode function?

printer.PrintBarCode(PrinterStation.Receipt, "Test", BarCodeSymbology.QRCode, 100, 100, 1, BarCodeTextPosition.Above);

Kind Regards,
Michael
 
Share this answer
 
Comments
edaniel1984 11-May-16 15:06pm    
This doesn't work ... QRCode is not supported directly from that method.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900