please help me. I am new to c# POS .net printing and I am using an EPSON TM-T81 thermal printer for my project.
I already know how to print barcodes horizontally using the PosPrinter.PrintBarBarcode method but my problem is I want to print the barcode vertically.
I can print vertically any text using PosPrinter.RotatePrint method provided that i specify its PrintRotation to any of the following enums: Left90,Normal,Rigth90,Rotate180,Barcode,Bitmap
I noticed that the PrintRotaion contains both Barcode and Bitmap so I thought that I can also print barcode vertically using the PosPrinter.RotatePrint and i did this:
printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Barcode);
printer.PrintBarCode(PrinterStation.Receipt,"123",BarCodeSymbology.Code128,printer.RecLineHeight,printer.RecLineWidth,PosPrinter.PrinterBarCodeCenter,BarCodeTextPosition.Below);
printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Normal);
This code will perfectly compile but when i start to execute the code, an
exception will be handled as I have used try-catch in this block
This is the Exception:
Method RotatePrint threw an exception. Attempt was made to perform an illegal or unsupported operation with the device, or an invalid parameter value was used.
I read the PrintRotation.Barcode description and it says:
Rotate barcode printing. (ORed with one of the above rotation values.)
Now, what does the "(ORed with one of the above rotation values.)" mean? Do I have to specify another PrintRotation enum before my block of code like this?
the PosPrinter obj is named printer and has already been opened,claimed and enabled
printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Left90);
printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Barcode);
printer.PrintBarCode(PrinterStation.Receipt, "123", BarCodeSymbology.Code128, printer.RecLineHeight,printer.RecLineWidth,PosPrinter.PrinterBarCodeCenter,BarCodeTextPosition.Below);
printer.RotatePrint(PrinterStation.Receipt, PrintRotation.Normal);
When i try to execute these statements i still get the same exception.
Please help me. Can barcode be printed vertically? Is this is not the way to print the barcode
vertically? Thank you so much guys.
[Modified] Code Format [Modified]