Files
point_of_sale_v2/PointOfSale/EpsonPrinterLinux/Services/PrintString.cs
Bjarne Pedersen 170a03e7df Print problemer
Har muligvis rettet den print fejl der er - men mangler at få det testet.
Der er slettet en masse projekter som ikke bliver brugt mere.
Og flyttet rundt på de få projekter som er tilbage.
Dette er V2 og i sit eget repo, så dette er initial commit
2026-07-15 22:40:53 +02:00

38 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace EpsonPrinter.Services
{
public class PrintString
{
/// <summary>
/// An appropriate interval is converted into the length of
/// the tab about two texts. And make a printing data.
/// </summary>
/// <param name="iLineChars">
/// The width of the territory which it prints on is converted into the number of
/// characters, and that value is specified.
/// </param>
/// <param name="strBuf">
/// It is necessary as an information for deciding the interval of the text.
/// </param>
/// <param name="strPrice">
/// It is necessary as an information for deciding the interval of the text, too.
/// </param>
/// <returns>printing data.
/// </returns>
public String MakePrintString(int iLineChars, String strBuf, String strPrice)
{
int bufferWidth = Math.Max(0, iLineChars - strPrice.Length);
if (strBuf.Length > bufferWidth)
{
strBuf = strBuf.Substring(0, bufferWidth);
}
return strBuf.PadRight(bufferWidth) + strPrice;
}
}
}