Question

I am using POS for .NET to print receipts in my POS application. I have a problem with formatting the receipt. I want to apply two alignments in same line. First word should be left aligned and second word should be right aligned

I have tried following code in VB.NET

Dim ESC As String = Chr(&H1B)
Dim displayString As String
displayString += "Description"
displayString += ESC + "|rAQty" + ESC + "|1lF"

But alignment applied for the 'Qty' is not working. Both words a displayed in left aligned. If I use 'Qty' in a another line it works. But I need this two texts are in same line.

How do I do this

Was it helpful?

Solution

UPOS escape sequences are implemented by the device-specific service object according to the capabilities of the hardware.

It may be that your hardware doesn't support mixing alignment on a single line.

Possible solutions might be:

  • Overprinting the line, e.g. by performing a reverse line feed. Though this might be slow.

  • If you're using a fixed width font, generate a string in your application with the text aligned appropriately, rather than using escape sequences.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top